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

Phillip J. Eby pje at telecommunity.com
Thu Jan 13 18:38:46 CET 2005


At 09:02 AM 1/13/05 -0800, Guido van Rossum wrote:
>[Armin]
> > I guess that a name-based hack in type_new() to turn all __*__() 
> methods into
> > data descriptors would be even more obscure?
>
>To the contary, I just realized in this would in fact be the right
>approach. In particular, any *descriptor* named __*__ would be
>considered a "data descriptor". Non-descriptors with such names can
>still be overridden in the instance __dict__ (I believe this is used
>by Zope).

It should check that the __*__-named thing isn't *already* an override 
descriptor, though.



More information about the Python-Dev mailing list