Newbie can't figure out documentation practices

Fernando Perez fperez528 at yahoo.com
Fri May 9 17:24:55 EDT 2003


sismex01 at hebmex.com wrote:

> OK, this is as small as I can make it and keep it usefull:
> 
>>>> class InterpolationDictClass:
> def __getitem__(self, name):
>             frame = sys._getframe(1)
>             return eval(name, frame.f_globals, frame.f_locals)
> 
> 

I like it :)

Well, at least this round of discussions did get us the shortest possible
implementation of a reasonable solution, which works even for nested
objects (like a.b.c.d).

I hold to my point of considering this a wart for the reasons I've given. 
But I like this solution enough to probably just make it routine in my
coding.  Then I'll stop caring and won't bring up the topic again ;)

Cheers,

f.




More information about the Python-list mailing list