mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-28 04:37:32 +07:00
In Python 2 it is possible to create an endless metaclass chain by defining '__metaclass__' at the top-level to be one of the classes defined in the module. We assume that these circular metaclasses don't override `mro()` in order to prevent infinite recursion in this check.
12 lines
107 B
Python
12 lines
107 B
Python
class __metaclass__(object):
|
|
pass
|
|
|
|
|
|
class C(object):
|
|
def foo(self):
|
|
pass
|
|
|
|
|
|
c = C()
|
|
c.foo()
|