Can dictionary values access their keys?

Matthew Thorley ruach at chpc.utah.edu
Fri Apr 8 14:49:59 EDT 2005


Steve Holden wrote:

> Indeed, they will probably just need to pass "self" as an argument to
> the child object's creator (it will become an argument to the __init__()
> method). This will be pretty cheap, since the additional attribute will
> be bound to an already-existing value.
> 
>> On the other hand, the introspecitve stuff is cool! When you say "make
>> more work for yourself" are you talking about 400 lines of code or 50.
>> Further, is there much processing required to do the magic? When python
>> do introspective magic, is it memory intensive? by that I mean does it
>> have to make copies of the objects to do the look-ups?
>>
> Frankly I am not sure I see the advantage. You seem to be saying that
> rather than provide each child object with a reference to its parent you
> would rather provide it with a reference to the collection of parent
> objects and let it work out which one it wants. Where's the benefit?
All right then.

> Happy to help, but I can't take credit for the grant, since all I did as
> a PSF director was vote affirmatively on the recommendations of Martin
> von Lowis' extremely hard-working grants committee.

Thanks to the PSF for the grant!

-Matthew



More information about the Python-list mailing list