Aug. 13, 2013
3:32 p.m.
13.08.13 22:23, Serhiy Storchaka написав(ла):
13.08.13 20:45, Terry Reedy написав(ла):
As I understand the proposal, it is not to actually make None a context manager with __enter__ and __exit__ methods (bad),
Why?
but to make it a signal to not do the normal calls.
I agree this is a bad idea.
Sorry, I misunderstood you. Skipping the body of the with statement is a bad idea (because it converts with into other control construction). But skipping calls of __enter__() and __exit__() methods looks just as an optimization an implementation detail (at least for None).