I need a dict that inherits its mappings

Rachel P msrachel.e at gmail.com
Fri Jun 26 00:47:51 EDT 2009


On Jun 25, 5:31 am, samwyse <samw... at gmail.com> wrote:
> I need a dict-like object that, if it doesn't contain a key, will
> return the value from a "parent" object.  

See:  http://code.activestate.com/recipes/305268/
Also try subclassing dict and implementing a __missing__() method.


Raymond




More information about the Python-list mailing list