[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-09-03 Thread Antony Lee
Change by Antony Lee : -- nosy: -Antony.Lee ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-09-03 Thread Nick Coghlan
Nick Coghlan added the comment: This is a documentation bug, as the current behaviour is as intended, but the documented equivalence doesn't hold for generator functions: for a generator function, the CM will only be applied when the generator is instantiated, whereas the inline context

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-02 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37743] How should contextmanager/ContextDecorator work with generators?

2019-08-01 Thread Antony Lee
New submission from Antony Lee : The docs for ContextDecorator (of which contextmanager is a case) describe its semantics as: ... for any construct of the following form: def f(): with cm(): # Do stuff ContextDecorator lets you instead write: @cm()