Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression on master branch: false-positive error for enum mixin data types #12258

Closed
AlexWaygood opened this issue Feb 27, 2022 · 1 comment · Fixed by #12260
Closed

Regression on master branch: false-positive error for enum mixin data types #12258

AlexWaygood opened this issue Feb 27, 2022 · 1 comment · Fixed by #12260
Assignees
Labels
bug mypy got something wrong

Comments

@AlexWaygood
Copy link
Member

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:

cc. @sobolevn

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Feb 27, 2022

Looks like an issue in #12026. We could revert for now if blocking a release.

JukkaL pushed a commit that referenced this issue Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants