[Python-ideas] ChainMap as a context manager

dag.odenhall at gmail.com dag.odenhall at gmail.com
Sun Aug 7 16:50:18 CEST 2011


How about adding the context manager protocol to collections.ChainMap,
as an in-place combination of new_child() and parents()? The effect
would simulate lexical scope using the with-statement.

Trivial to do customly but always nice when builtin or stdlib types
support the context manager protocol. :)



More information about the Python-ideas mailing list