How to copy a ClassObject?

Peter Otten __peter__ at web.de
Tue Mar 20 09:59:26 EDT 2007


Karlo Lozovina wrote:

> Yes, I can do a:
>   class tmp(First):
>       pass
> 
> but I'd rather make a copy than a subclass.

> tmp = new.classobj('tmp', (First,), {})

That line creates a subclass just as the simpler approach you gave above.

Peter





More information about the Python-list mailing list