8000 Marks enums with values as implicitly final by sobolevn · Pull Request #11247 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

Marks enums with values as implicitly final #11247

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

Merged
merged 5 commits into from
Oct 31, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Adds explicit test case for nested class
  • Loading branch information
sobolevn committed Oct 8, 2021
commit c02f412a4fc08bc3d8eb33a3316228ee7fc28120
8 changes: 8 additions & 0 deletions test-data/unit/check-enum.test
Original file line number Diff line number Diff line change
Expand Up @@ -1636,3 +1636,11 @@ class ErrorFlagWithoutValue(NonEmptyFlag): # E: Cannot inherit from final class
class ErrorIntFlagWithoutValue(NonEmptyIntFlag): # E: Cannot inherit from final class "NonEmptyIntFlag"
pass
[builtins fixtures/bool.pyi]

[case testFinalEnumWithClassDef]
from enum import Enum

class A(Enum):
class Inner: pass
class B(A): pass # E: Cannot inherit from final class "A"
[builtins fixtures/bool.pyi]
0