Issue34536
Created on 2018-08-28 19:37 by Paul Pinterits, last changed 2019-07-16 03:17 by ethan.furman. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 9147 | merged | ethan.furman, 2018-09-12 00:00 | |
| PR 9147 | merged | ethan.furman, 2018-09-12 00:00 | |
| PR 9147 | merged | ethan.furman, 2018-09-12 00:00 | |
| PR 9381 | closed | miss-islington, 2018-09-18 01:12 | |
| PR 9978 | merged | vstinner, 2018-10-19 23:03 | |
| PR 9979 | merged | vstinner, 2018-10-19 23:06 | |
| Messages (7) | |||
|---|---|---|---|
| msg324282 - (view) | Author: Paul Pinterits (Paul Pinterits) | Date: 2018-08-28 19:37 | |
In a conversation with Ethan Furman (the author of the enum module) I've been informed that Enum automatically checks whether the _missing_ method has returned an instance of the correct class, and raises a TypeError if not. (Link: https://stackoverflow.com/a/52064774/1222951) However, this simply does not happen. ``` import enum class MyEnum(enum.Enum): FOO = "foo" @classmethod def _missing_(cls, value): return 5 print(MyEnum('bar')) # output: 5 ``` |
|||
| msg325165 - (view) | Author: Ethan Furman (ethan.furman) * | Date: 2018-09-12 18:43 | |
New changeset 019f0a0cb85ebc234356415f3638b9bd77528e55 by Ethan Furman in branch 'master': bpo-34536: raise error for invalid _missing_ results (GH-9147) https://github.com/python/cpython/commit/019f0a0cb85ebc234356415f3638b9bd77528e55 |
|||
| msg328071 - (view) | Author: STINNER Victor (vstinner) * | Date: 2018-10-19 23:07 | |
I wrote PR 9978 to backport the fix to Python 3.7. Should the fix be backported to Python 3.6 as well? |
|||
| msg328086 - (view) | Author: Ethan Furman (ethan.furman) * | Date: 2018-10-19 23:43 | |
Change by STINNER Victor: > pull_requests: +9319 Why does the above say 9319 when the PR is 9978? |
|||
| msg328089 - (view) | Author: Ethan Furman (ethan.furman) * | Date: 2018-10-19 23:49 | |
New changeset 0f2fc8bee0b435ee2934751264196db30d16ed8a by Ethan Furman (Victor Stinner) in branch '3.7': bpo-34536: raise error for invalid _missing_ results (GH-9147) (GH-9978) https://github.com/python/cpython/commit/0f2fc8bee0b435ee2934751264196db30d16ed8a |
|||
| msg328090 - (view) | Author: STINNER Victor (vstinner) * | Date: 2018-10-19 23:54 | |
> Why does the above say 9319 when the PR is 9978? Roundup (the software running bugs.python.org) logs its own internal identifier for pull requests. Following https://bugs.python.org/pull_request9320 may help you to understand :-) |
|||
| msg328091 - (view) | Author: Ethan Furman (ethan.furman) * | Date: 2018-10-19 23:57 | |
New changeset 4acf6c9d4be77b968fa498569d7a1545e5e77344 by Ethan Furman (Victor Stinner) in branch 'master': bpo-34536: Cleanup test_enum imports (GH-9979) https://github.com/python/cpython/commit/4acf6c9d4be77b968fa498569d7a1545e5e77344 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2019-07-16 03:17:12 | ethan.furman | set | keywords:
patch, patch, patch status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-10-19 23:57:23 | ethan.furman | set | messages: + msg328091 |
| 2018-10-19 23:54:17 | vstinner | set | keywords:
patch, patch, patch messages: + msg328090 |
| 2018-10-19 23:49:33 | ethan.furman | set | messages: + msg328089 |
| 2018-10-19 23:43:09 | ethan.furman | set | messages: + msg328086 |
| 2018-10-19 23:07:51 | vstinner | set | keywords:
patch, patch, patch nosy: + vstinner messages: + msg328071 |
| 2018-10-19 23:06:18 | vstinner | set | pull_requests: + pull_request9320 |
| 2018-10-19 23:03:27 | vstinner | set | pull_requests: + pull_request9319 |
| 2018-09-18 01:12:20 | miss-islington | set | pull_requests: + pull_request8805 |
| 2018-09-12 18:43:37 | ethan.furman | set | messages: + msg325165 |
| 2018-09-12 00:00:13 | ethan.furman | set | keywords:
+ patch stage: patch review pull_requests: + pull_request8638 |
| 2018-09-12 00:00:12 | ethan.furman | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request8637 |
| 2018-09-12 00:00:08 | ethan.furman | set | keywords:
+ patch stage: (no value) pull_requests: + pull_request8636 |
| 2018-09-03 09:03:46 | xtreak | set | nosy:
+ xtreak |
| 2018-08-31 19:30:03 | ethan.furman | set | assignee: ethan.furman nosy: + ethan.furman |
| 2018-08-28 19:37:44 | Paul Pinterits | create | |