Aug. 13, 2013
3:29 p.m.
Furthermore: On 2013-08-13, at 16:48 , Serhiy Storchaka wrote:
And when the with statement will support None as a "null-manager":
I think that is a terrible idea, and will be a source of woe and bugs more than a solution to anything. If you want an optional context manager, why not create an OptionalContextManager(object | None) which delegates to the underlying non-None CM? That's simple, that's clear, that's explicit, and that's not a hack.