Created
January 26, 2012 23:19
-
-
Save Deepwalker/1685777 to your computer and use it in GitHub Desktop.
py3 metaclass hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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