Skip to content

Instantly share code, notes, and snippets.

@matklad
Created December 10, 2015 20:54
Show Gist options
  • Save matklad/58ff2086bd05d4fccb56 to your computer and use it in GitHub Desktop.
Save matklad/58ff2086bd05d4fccb56 to your computer and use it in GitHub Desktop.
class MetaSpam(type):
def __new__(cls, name, bases, ns, *, metaarg=92):
print("new", metaarg)
return super().__new__(cls, name, bases, ns)
def __init__(self, name, bases, ns, *, metaarg=92):
print("init", metaarg)
super().__init__(name, bases, ns)
class A(metaclass=MetaSpam, metaarg="WUT?"):
pass
a = A()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment