This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Denaun, barry, docs@python, ncoghlan
Date 2017-12-01.05:34:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512106447.81.0.213398074469.issue32145@psf.upfronthosting.co.za>
In-reply-to
Content
Hmm, I think that may actually qualify as a bug in the `pop_all()` implementation: https://docs.python.org/3/library/contextlib.html#contextlib.ExitStack.pop_all states that it returns an ExitStack instance, not an instance of the current type.

For 3.6 (and hence the online docs), we can fix the recipe to allow for `callback=None` (with the expectation that the callback will be added afterwards).

Barry, I'd be interested in your thoughts on what to do for 3.7+ - we can either leave the current behaviour alone, and amend the documentation, or else change the code to call ExitStack directly, rather than type(self).

I'm leaning towards only changing the docs as being lower risk - folks may be relying on the current behaviour, so changing it may break their code, whereas changing the docs doesn't risk breaking anything.
History
Date User Action Args
2017-12-01 05:34:07ncoghlansetrecipients: + ncoghlan, barry, docs@python, Denaun
2017-12-01 05:34:07ncoghlansetmessageid: <1512106447.81.0.213398074469.issue32145@psf.upfronthosting.co.za>
2017-12-01 05:34:07ncoghlanlinkissue32145 messages
2017-12-01 05:34:07ncoghlancreate