using __getitem()__ correctly

Charles T. Smith cts.private.yahoo at gmail.com
Wed Dec 30 17:58:51 EST 2015


On Wed, 30 Dec 2015 22:54:44 +0000, Charles T. Smith wrote:
> But I concede I must be doing something fundamentally wrong because this
> assert is triggering:
>     def __getattr__ (self, name):
>         print "attrdict:av:__getattr__: entered for ", name

>         assert name not in self.keys(), "attrdict:__getattr__: who lied?"

Tt's really a hassle how pan(1) sometimes wraps and sometimes doesn't.
Is there a better way to do this?



More information about the Python-list mailing list