guneysus
11/22/2014 - 9:06 PM

Creating new types in a fully dynamic manner http://stackoverflow.com/a/108297

Creating new types in a fully dynamic manner http://stackoverflow.com/a/108297

>>> NewType = type("NewType", (object,), {"x": "hello"})
>>> n = NewType()
>>> n.x
"hello"