Creating new classes on the fly

Mike C. Fletcher mcfletch at
Tue Oct 5 23:03:23 CEST 2004

Carlos Ribeiro wrote:

>I've found two different ways to do it in the documentation:
>new.classobj(name, baseclasses, dict)
This creates an old-style class (new.classobj being the old-style 

>type(name, bases, dict)
This creates a new-style class (i.e. with property support, 
super-support, you know, the fun stuff).

>I assume that both end up calling the same code, but I really don't
>know which one am I supposed to call, in terms of being the most
>'pythonic' way. Are both the same? Is one of them preferred over the
New code should likely be using type.


  Mike C. Fletcher
  Designer, VR Plumber, Coder

More information about the Python-list mailing list