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.
Created on 2017年05月04日 03:37 by JelleZijlstra, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 1448 | merged | JelleZijlstra, 2017年05月04日 03:42 | |
| PR 2054 | merged | Mariatta, 2017年06月10日 01:10 | |
| Messages (7) | |||
|---|---|---|---|
| msg292955 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) | Date: 2017年05月04日 03:37 | |
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. |
|||
| msg295541 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2017年06月09日 15:21 | |
New changeset 57161aac5eb9bcb0b43e551a1937ff0a84c1ec52 by Guido van Rossum (Jelle Zijlstra) in branch 'master': bpo-30266: support "= None" pattern in AbstractContextManager (#1448) https://github.com/python/cpython/commit/57161aac5eb9bcb0b43e551a1937ff0a84c1ec52 |
|||
| msg295547 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2017年06月09日 15:55 | |
This should be backported to 3.6. |
|||
| msg295603 - (view) | Author: Mariatta (Mariatta) * (Python committer) | Date: 2017年06月10日 03:36 | |
New changeset 753422f6e32e13d96319b090788f0474f1e21fc4 by Mariatta in branch '3.6': bpo-30266: support "= None" pattern in AbstractContextManager (GH-1448) (GH-2054) https://github.com/python/cpython/commit/753422f6e32e13d96319b090788f0474f1e21fc4 |
|||
| msg295604 - (view) | Author: Mariatta (Mariatta) * (Python committer) | Date: 2017年06月10日 03:38 | |
PR has been backported to 3.6. Thanks :) |
|||
| msg295607 - (view) | Author: Guido van Rossum (gvanrossum) * (Python committer) | Date: 2017年06月10日 04:12 | |
Thanks Mariatta! |
|||
| msg295608 - (view) | Author: Jelle Zijlstra (JelleZijlstra) * (Python committer) | Date: 2017年06月10日 04:37 | |
Thanks for doing the merge and backport! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:46 | admin | set | github: 74452 |
| 2017年06月10日 04:37:55 | JelleZijlstra | set | messages: + msg295608 |
| 2017年06月10日 04:12:43 | gvanrossum | set | messages: + msg295607 |
| 2017年06月10日 03:38:08 | Mariatta | set | status: open -> closed resolution: fixed messages: + msg295604 stage: backport needed -> resolved |
| 2017年06月10日 03:36:30 | Mariatta | set | messages: + msg295603 |
| 2017年06月10日 01:10:25 | Mariatta | set | pull_requests: + pull_request2114 |
| 2017年06月09日 16:17:55 | Mariatta | set | assignee: Mariatta nosy: + Mariatta stage: backport needed |
| 2017年06月09日 15:55:37 | gvanrossum | set | messages: + msg295547 |
| 2017年06月09日 15:21:50 | gvanrossum | set | nosy:
+ gvanrossum messages: + msg295541 |
| 2017年05月04日 03:42:12 | JelleZijlstra | set | pull_requests: + pull_request1546 |
| 2017年05月04日 03:37:32 | JelleZijlstra | create | |