Create classes at runtnime

Miki Tebeka miki.tebeka at gmail.com
Sat Feb 5 18:49:52 CET 2011


> I need to create a pretty complex class at runtime.
You can take the approach that namedtuple does and create a python code for the class as string and then exec it. See http://svn.python.org/view/python/trunk/Lib/collections.py?view=markup

HTH,
--
Miki
http://pythonwise.blogspot.com



More information about the Python-list mailing list