In class MetaA type def __new__ cls name bases dct super MetaA cls __n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
In [4]: class MetaA(type):
...: def __new__(cls, name, bases, dct):
...: super(MetaA, cls).__new__(name, bases, dct)
...:
In [5]: class A2(object):
...: __metaclass__ = MetaA
...:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/home/xa4a/<ipython console> in <module>()
/home/xa4a/<ipython console> in __new__(cls, name, bases, dct)
TypeError: Error when calling the metaclass bases
type.__new__(X): X is not a type object (str)