Top "Metaclass" questions

In object-oriented programming, a metaclass is a class whose instances are classes.

What are metaclasses in Python?

In Python, what are metaclasses and what do we use them for?

python oop metaclass python-datamodel
Creating a singleton in Python

This question is not for the discussion of whether or not the singleton design pattern is desirable, is an anti-pattern, …

python singleton decorator base-class metaclass
How does Django's Meta class work?

I am using Django which allows people to add extra parameters to a class by using class Meta. class FooModel(…

python django metaclass
Resolving metaclass conflicts

I need to create a class that uses a different base class depending on some condition. With some classes I …

python python-3.x multiple-inheritance metaclass
Error when calling the metaclass bases: function() argument 1 must be code, not str

I tried to subclass threading.Condition earlier today but it didn't work out. Here is the output of the Python …

python class inheritance metaclass
How to auto register a class when it's defined

I want to have an instance of class registered when the class is defined. Ideally the code below would do …

python oop design-patterns decorator metaclass
"MetaClass", "__new__", "cls" and "super" - what is the mechanism exactly?

I have read posts like these: What is a metaclass in Python? What are your (concrete) use-cases for metaclasses in …

python types metaclass super
What are some (concrete) use-cases for metaclasses?

I have a friend who likes to use metaclasses, and regularly offers them as a solution. I am of the …

python metaclass
Python Metaclass : Understanding the 'with_metaclass()'

I want to ask what the with_metaclass() call means in the definition of a class. E.g.: class Foo(…

python metaclass six-python