new module and class/type unification.

Alex Martelli aleax at aleax.it
Fri Jul 26 03:14:05 EDT 2002


Fredrik Stenberg wrote:

> 
> Morning.. its 04:26 localtime so my intellect is not on top.
> Anyway.. I'm playing with the class/type unification and i don't
> understand why the following code doesn't work (2.2)
> 
> import new
> new.instance(str,None)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> TypeError: instance() argument 1 must be class, not type
> 
> 
> Is this is a bug? or am i missing the big picture
> in type/class unification and the new-module?
> 
> /fredriks alias princeps...

new.instance only supports classic classes, that's all.
Nothing mysterious at all.


Alex




More information about the Python-list mailing list