[issue10049] Add a "no-op" (null) context manager to contextlib

Hrvoje Nikšić report at bugs.python.org
Fri Oct 8 14:48:34 CEST 2010


Hrvoje Nikšić <hniksic at gmail.com> added the comment:

I considered using a variable, but I went with the factory function for two reasons: consistency with the rest of contextlib, and equivalence to the contextmanager-based implementation.

Another reason is that it leaves the option of adding optional parameters at a later point.  I know, optional parameters aren't likely for a "null" constructor, but still... it somehow didn't feel right to relinquish control.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10049>
_______________________________________


More information about the Python-bugs-list mailing list