Created on 2020-09-30 04:21 by puddly, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 22487 | merged | ethan.furman, 2020-10-01 23:34 | |
| PR 23672 | merged | miss-islington, 2020-12-07 08:19 | |
| PR 23673 | merged | miss-islington, 2020-12-07 08:19 | |
| Messages (5) | |||
|---|---|---|---|
| msg377692 - (view) | Author: (puddly) | Date: 2020-09-30 04:21 | |
The following code worked in 3.8.5 but does not in 3.8.6 due to the fix for #39587: ``` import enum class MyInt(int): def __new__(cls, value): return super().__new__(cls, value) class HexMixin: def __repr__(self): return hex(self) class MyIntEnum(HexMixin, MyInt, enum.Enum): pass class Foo(MyIntEnum): TEST = 1 assert isinstance(Foo.TEST, MyInt) assert repr(Foo.TEST) == "0x1" ``` In 3.8.6, the `Foo` enum itself fails to be created because `HexMixin` is now considered the member type instead of `MyInt`: ``` Traceback (most recent call last): File "enum_test.py", line 18, in <module> class Foo(MyIntEnum): File "/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/lib/python3.8/enum.py", line 215, in __new__ enum_member = __new__(enum_class) TypeError: object.__new__(Foo) is not safe, use int.__new__() ``` |
|||
| msg377709 - (view) | Author: William Pickard (WildCard65) * | Date: 2020-09-30 15:51 | |
Actually, this is an issue with native types in general that define a 'tp_new' slot value ('!= NULL').
|
|||
| msg382623 - (view) | Author: Ethan Furman (ethan.furman) * ![]() |
Date: 2020-12-07 08:17 | |
New changeset c266736ec1f9ebef38b134ceb4832df015711b38 by Ethan Furman in branch 'master': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) https://github.com/python/cpython/commit/c266736ec1f9ebef38b134ceb4832df015711b38 |
|||
| msg382699 - (view) | Author: Ethan Furman (ethan.furman) * ![]() |
Date: 2020-12-07 23:50 | |
New changeset 699e5e448919283578afe445069ab93b34bf8eae by Miss Islington (bot) in branch '3.8': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) (GH-23672) https://github.com/python/cpython/commit/699e5e448919283578afe445069ab93b34bf8eae |
|||
| msg382700 - (view) | Author: Ethan Furman (ethan.furman) * ![]() |
Date: 2020-12-07 23:51 | |
New changeset be52ca45d9eb9c3e8941e46ddc67a210f0f4c6fa by Miss Islington (bot) in branch '3.9': bpo-41889: [Enum] fix multiple-inheritance regression (GH-22487) (GH-23673) https://github.com/python/cpython/commit/be52ca45d9eb9c3e8941e46ddc67a210f0f4c6fa |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:36 | admin | set | github: 86055 |
| 2020-12-08 03:21:43 | ethan.furman | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2020-12-07 23:51:19 | ethan.furman | set | messages: + msg382700 |
| 2020-12-07 23:50:27 | ethan.furman | set | messages: + msg382699 |
| 2020-12-07 08:19:40 | miss-islington | set | pull_requests: + pull_request22539 |
| 2020-12-07 08:19:33 | miss-islington | set | nosy:
+ miss-islington pull_requests: + pull_request22538 |
| 2020-12-07 08:17:43 | ethan.furman | set | messages: + msg382623 |
| 2020-10-01 23:35:19 | ethan.furman | set | assignee: ethan.furman |
| 2020-10-01 23:34:28 | ethan.furman | set | keywords:
+ patch stage: patch review pull_requests: + pull_request21505 |
| 2020-09-30 15:51:26 | WildCard65 | set | nosy:
+ WildCard65 messages: + msg377709 |
| 2020-09-30 04:21:36 | puddly | create | |
