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

Neil Schemenauer nascheme@enme.ucalgary.ca
Fri, 21 Jul 2000 11:19:54 -0600


On Fri, Jul 21, 2000 at 11:25:39AM -0500, Paul Prescod wrote:
> PEP: ???
> Title: Attribute Access Handlers
> Version: $Revision: 1.0 $
> Owner: paul@prescod.net
> Python-Version: 2.0
> Status: Incomplete

So far I'm a strong +1.  I dislike the all or nothing approach of
__setattr__ and the performance cost associated with it.  Support for
"attribute access handlers" should largely eliminate the need for
writing attribute access wrappers (getters and setters).  The benefits
are that code is simpler (you can use object attributes directly for
outside the class), performance is better, and you always have the
option of computing the value in the future without changing code that
uses the object.

  Neil