<ha************@gmail.comwrote:
Hello all,"built-in type" generally means "implemented in C", also sometimes
When do we actually see the error :
TypeError: Error when calling the metaclass bases
multiple bases have instance lay-out conflict
I searched the web and I could not find a correct guideline as to when such
an error could arise. One of the places said that "A new style class cannot
inherit from more than one python built-in class". That is.,
... pass>>>class A(dict,list):
wouldn't work.
called "extension type".
Both the Exception and ZODB Persistent objects are implemented in C,... pass>>>class A(Exception,persistent.Persistent):
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Error when calling the metaclass bases
multiple bases have instance lay-out conflict
Still declaration of class A fails. Any idea? What is the exact rule when
python throws up " multiple bases have instance lay-out conflict" error?
and they have different ideas for the format of the struct that holds
an object's data. It can be tricky to tell by introspection whether a
new-style class is implemented in Python or C. One possible
heuristic:
....>>class Foo(object): pass
True>>'__module__' in vars(Foo)
False>>'__module__' in vars(Exception)
I'm not sure whether this is valid in all cases. Someone else may
know of a better way.
-Miles