[Python-Dev] Descriptor write-up [Draft: Please comment]

Phillip J. Eby pje@telecommunity.com
Sun, 01 Jun 2003 12:31:07 -0400


At 08:57 AM 6/1/03 -0400, Guido van Rossum wrote:
>(I'd like to review this more carefully when I have more time, but one
>thing jumped out at me:)
>
>[Phillip Eby]
> > It would be a good idea to add some information about "data" and
> > "non-data" descriptors, and the differences of how their attribute
> > lookup is processed.  I recently posted here about the "attribute
> > lookup process" or something to that effect, which covered this.
> > Understanding data vs. non-data descriptors is important if you want
> > to do pretty much anything with descriptors beyond what property()
> > does.
>
>Note that I recently changed the treatment of data descriptors by
>super() in 2.3.  typeobject.c rev 2.227/2.228:

And an important change it is.  If you define methods on metaclasses that 
might also be defined by their instances (i.e. the classes) on behalf of 
*their* instances, the only way to get this to work right is to use data 
descriptors for the metaclass level methods.  Which then means super() 
breaks, so for 2.2 I have a custom 'super()' to work with data 
descriptors.  I rather wish you'd considered it a bugfix rather than a new 
feature.  :)