[Python-Dev] Pre-PEP: Attribute Access Handlers v2

Paul Prescod paul@prescod.net
Fri, 21 Jul 2000 13:49:23 -0500


Gordon McMillan wrote:
> 
> [snip]
> 
> > Proposed Implementation
> >
> >     There is a new object called a computed attribute object. It
> >     has three attributes: get, set, delete.
> 
> raise InternalInconsistencyError

Good point. Here's a fix for that and something else I left out before.

    There is a new object type called a computed attribute object. 
    Objects of this type have the following attributes:

       name (e.g. XXX, not __attr__XXX__
       method (pointer to a method object
   
    In PyClass_New, methods of
    the appropriate form will be detected and converted into objects
    (just like unbound method objects). If there are any computed 
    attributes in an instance at all, a flag is set. Let's call 
    it "I_have_computed_attributes" for now. Derived classes inherit
    the flag from base classes. Instances inherit the flag from
    classes.


-- 
 Paul Prescod - Not encumbered by corporate consensus
"Hardly anything more unwelcome can befall a scientific writer than 
having the foundations of his edifice shaken after the work is 
finished.  I have been placed in this position by a letter from 
Mr. Bertrand Russell..." 
 - Frege, Appendix of Basic Laws of Arithmetic (of Russell's Paradox)