Nested Mapping

Paul Rubin no.email at nospam.invalid
Thu Oct 21 20:18:23 EDT 2010


Raymond Hettinger <python at rcn.com> writes:
> Hopefully, that discussion can be in a separate thread.
> This is really about keeping all the nice O(1) characteristics
> of dicts and keeping their straight-forward API while adding
> the ability to support nested lookups.

Are you saying the O(1) characteristics are retained even when the
contexts are N levels deep?

> Sorry for the brush-off, but it would be ashamed if this thread got
> immediately hijacked, and I were to lose possible feedback on the
> API for nested mappings.

The API you suggested looks reasonable although you should also say how
to delete a context, how to find the inner contexts of a context, etc.

One question: what should

   c["foo"] = 7
   d = c.new_child()
   del d["foo"]

do?  



More information about the Python-list mailing list