Kay Schluehr wrote:
> def makeClass(cls_name, **kw):
>     return type(cls_name,(), kw)
> 
>>>>MyObject = makeClass("MyObject",a=8)
>>>>MyObject

As said to Bengt, a place is needed to write the class definition. 
There's no need for metaclass in that case:

def makeType(a, b, c=someDefault):
     arguments = locals()
     class MyObject:
         pass # Complete definition here
     MyObject.__dict__.update(arguments)
     return MyObject

Regards,
Nicolas
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to