Erm... might I suggest... (Re: New PEP: Attribute Access Handlers)

Paul Prescod paul at prescod.net
Tue Jul 25 01:12:15 EDT 2000


Greg Ewing wrote:
> 
> To get attribute attr_name:
>    if attr_name is in the instance dict:
>       return it

If I understand this correctly, then the very first time you add the
attribute to the dict you effectively wipe out the accessor because the
test above will evaluate true every time and the branch that uses
accessors will never get called.

If so, then your proposal does not allow the use of the XXX entry in the
dict for arbitrary values. That would have been the primary benefit over
my latest proposal.

Subject: Attributes PEP Enhancement
   Date: Mon, 24 Jul 2000 01:00:02 -0500

-- 
 Paul Prescod - Not encumbered by corporate consensus
New from Computer Associates: "Software that can 'think', sold by 
marketers who choose not to."




More information about the Python-list mailing list