Closed
Description
Using the current master branch, mypy reports a false positive error for the following snippet of code:
from enum import Enum
class MyEnum(Enum): ...
class BytesEnum(bytes, MyEnum): ... # error: Only a single data type mixin is allowed for Enum subtypes, found extra "enum_test.MyEnum"
The error is not reported using mypy 0.931.
Expected behaviour
There should be no error reported; this works fine at runtime (and this inheritance structure is in fact used within enum.py
in the CPython stdlib).
Related:
- Basic support for Python 3.11's typeshed #12220
- Fix several mypy errors when run on the 3.11 stdlib typeshed#7389
cc. @sobolevn