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 JelleZijlstra
Recipients JelleZijlstra, levkivskyi, ncoghlan, yselivanov
Date 2017-05-04.03:37:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493869052.62.0.588224367521.issue30266@psf.upfronthosting.co.za>
In-reply-to
Content
Like other ABCs, contextlib.AbstractContextManager should support the pattern where setting a method to None disables structural subtyping, which was introduced across the standard library in issue 25958. Ivan Levkivskyi suggested making AbstractContextManager support this pattern in CR comments in https://github.com/python/cpython/pull/1412/files#r114482765.

Should this change be applied to 3.6 as well as master? I'm leaning towards yes, because the resolution to issue 25958 (https://hg.python.org/cpython/rev/72b9f195569c) added a general statement in the documentation that "Setting a special method to ``None`` indicates that the corresponding operation is not available". Thus, the fact that contextlib.AbstractContextManager doesn't obey this rule is a bug.

I'll send a PR shortly.
History
Date User Action Args
2017-05-04 03:37:32JelleZijlstrasetrecipients: + JelleZijlstra, ncoghlan, yselivanov, levkivskyi
2017-05-04 03:37:32JelleZijlstrasetmessageid: <1493869052.62.0.588224367521.issue30266@psf.upfronthosting.co.za>
2017-05-04 03:37:32JelleZijlstralinkissue30266 messages
2017-05-04 03:37:31JelleZijlstracreate