Created
November 26, 2016 23:00
-
-
Save math2001/0c4a47aacb29d44e9f24a0689f85a186 to your computer and use it in GitHub Desktop.
A better stdclass for python: save the class name
This file contains 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 StdClass(name='Unknown'): | |
return type(name.title(), (), {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You get a easy-to-understand traceback (
Line has no...
, notStdClass has no...
or whatever. You choose the name)