Skip to content Skip to sidebar Skip to footer
Showing posts with the label Metaclass

Is It Possible To Dynamically Create A Metaclass For A Class With Several Bases, In Python 3?

In Python 2, with a trick it is possible to create a class with several bases, although the bases h… Read more Is It Possible To Dynamically Create A Metaclass For A Class With Several Bases, In Python 3?

Subclassing Type Vs Object In Python3

I've been reading about metaclasses and I got lost when it came to type and object classes. I u… Read more Subclassing Type Vs Object In Python3

Why Doesn't The Namedtuple Module Use A Metaclass To Create Nt Class Objects?

I spent some time investigating the collections.namedtuple module a few weeks ago. The module uses … Read more Why Doesn't The Namedtuple Module Use A Metaclass To Create Nt Class Objects?

How Does Ipython's ? (question Mark) Operator Actually Work?

So i was thinking that in order to implement such a feature in a console application , where append… Read more How Does Ipython's ? (question Mark) Operator Actually Work?

How To Register Implementation Of Abc.mutablemapping As A Dict Subclass?

I would like my SpreadSheet class below to be considered a dict subclass by the isinstance() built-… Read more How To Register Implementation Of Abc.mutablemapping As A Dict Subclass?

Python 3.9 Metaclass Property Vs Classmethod Property

Consider the following code from abc import ABC, ABCMeta class MyMetaClass(ABCMeta): @propert… Read more Python 3.9 Metaclass Property Vs Classmethod Property

The Built-in Keyword Type Means A Function Or A Class In Python?

In most posts, people often say type is a built-in function if it is provided with one argument, an… Read more The Built-in Keyword Type Means A Function Or A Class In Python?

Subclass __module__ Set To Metaclass Module When Manually Creating New Class With Type()

In the following example, the newly created subclass ends up being the metaclass __module__ rather … Read more Subclass __module__ Set To Metaclass Module When Manually Creating New Class With Type()