Dictionary Enhancement?

Rich Harkins rich at worldsinfinite.com
Thu Oct 31 09:12:11 EST 2002


I was wondering if anyone else had been wanting to enhance Python
dictionaries such that instead of raising KeyError in the case of errors
that another method on the dictionary object, say __makeitem__ would be
called to try to auto-generate an appropriate value.  That __makeitem__
method would then either raise KeyError itself or return the value to
insert into the dictionary and return through __getitem__.

I scanned the PEP's but didn't see anything similar.

Rich








More information about the Python-list mailing list