Issue 34082: EnumMeta.new should use enum_class.new (original) (raw)
Issue34082
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.
This issue has been migrated to GitHub: https://github.com/python/cpython/issues/78263
classification
Title: | EnumMeta.__new__ should use enum_class.__new__ | ||
---|---|---|---|
Type: | behavior | Stage: | resolved |
Components: | Library (Lib) | Versions: | Python 3.6, Python 3.5 |
process
Status: | closed | Resolution: | duplicate |
---|---|---|---|
Dependencies: | Superseder: | Enum: mixin classes don't mix well with already mixed Enums View:29577 | |
Assigned To: | ethan.furman | Nosy List: | barry, eli.bendersky, ethan.furman, rs2 |
Priority: | normal | Keywords: |
Created on 2018-07-10 09:43 by rs2, last changed 2022-04-11 14:59 by admin. This issue is now closed.
Messages (2) | ||
---|---|---|
msg321370 - (view) | Author: Pav (rs2) | Date: 2018-07-10 09:43 |
```python class Foo: pass class Works(str, Foo, Enum): BAR = 'baz' class Fails(Foo, str, Enum): BAR = 'baz' ``` `Fails` fails to be created with an error: `TypeError: object.__new__(Fails) is not safe, use Fails.__new__()` See https://github.com/python/cpython/blob/e57f91a0f0d5700ec466c9dd0fd2d2b5323a5e76/Lib/enum.py#L205 | ||
msg324974 - (view) | Author: Ethan Furman (ethan.furman) * ![]() |
Date: 2018-09-11 01:21 |
The solution to 29577 will also fix this. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:02 | admin | set | github: 78263 |
2018-09-11 01:21:40 | ethan.furman | set | status: open -> closedsuperseder: Enum: mixin classes don't mix well with already mixed Enumsmessages: + resolution: duplicatestage: resolved |
2018-07-10 14:09:33 | ethan.furman | set | assignee: ethan.furmannosy: + barry, eli.bendersky, ethan.furman |
2018-07-10 09:43:46 | rs2 | create |
Supported by The Python Software Foundation,
Powered by Roundup
Copyright © 1990-2022, Python Software Foundation
Legal Statements