Title: EnumMeta.__new__ should use enum_class.__new__
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.5
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 2018-09-11 01:21 by ethan.furman. This issue is now closed.

Messages (2)
msg321370 - (view) Author: Pav (rs2) Date: 2018-07-10 09:43
class Foo:

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__()`

msg324974 - (view) Author: Ethan Furman (ethan.furman) * (Python committer) Date: 2018-09-11 01:21
The solution to 29577 will also fix this.
Date User Action Args
2018-09-11 01:21:40ethan.furmansetstatus: open -> closed
superseder: Enum: mixin classes don't mix well with already mixed Enums
messages: + msg324974

resolution: duplicate
stage: resolved
2018-07-10 14:09:33ethan.furmansetassignee: ethan.furman

nosy: + barry, eli.bendersky, ethan.furman
2018-07-10 09:43:46rs2create