getting special from type, not instance (was Re: [Python-Dev] copy confusion)

Guido van Rossum gvanrossum at gmail.com
Fri Jan 14 00:11:43 CET 2005


> > Let's do override descriptors.
> 
> A Pronouncement!!!
> 
> > And please, someone fix copy.py in 2.3 and 2.4.
> 
> Sure -- what way, though?  The way I proposed in my last post about it?

This would do it, right? (From your first post in this conversation
according to gmail:)

> Armin's fix was to change:
>
>     conform = getattr(type(obj), '__conform__', None)
>
> into:
>
>     for basecls in type(obj).__mro__:
>         if '__conform__' in basecls.__dict__:
>             conform = basecls.__dict__['__conform__']
>             break
>     else:
>         # not found

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list