Skip to content

Instantly share code, notes, and snippets.

@Deepwalker
Created January 26, 2012 23:19
Show Gist options
  • Save Deepwalker/1685777 to your computer and use it in GitHub Desktop.
Save Deepwalker/1685777 to your computer and use it in GitHub Desktop.
py3 metaclass hack
def py3metafix(cls):
if not py3:
return cls
else:
newcls = cls.__metaclass__(cls.__name__, (cls,), {})
newcls.__doc__ = cls.__doc__
return newcls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment