Skip to content

Instantly share code, notes, and snippets.

@kokjo
Created March 23, 2020 20:43
Show Gist options
  • Save kokjo/3f3fd4ad3597ac0c1b283551d02b2499 to your computer and use it in GitHub Desktop.
Save kokjo/3f3fd4ad3597ac0c1b283551d02b2499 to your computer and use it in GitHub Desktop.
class A(type):
def __new__(cls, clsname, bases, attrs):
print cls, clsname, bases, attrs
newclass = super(A, cls).__new__(cls, clsname, bases, attrs)
return newclass
class B(object):
__metaclass__ = A
class C(B): pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment