-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionenhancement requestNew feature or requestNew feature or requestspec compliance
Description
When an enum class is created, the EnumType metaclass replaces its original constructor with a new implementation that performs a value-based lookup. The following should therefore type check without errors.
from enum import Enum
class Example(Enum):
A = (1, 2)
def __init__(self, value, other) -> None:
self._value_ = value
self.other = other
Example(1) # This should not generate an errorReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionenhancement requestNew feature or requestNew feature or requestspec compliance