mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-19 04:24:41 +00:00
Update comments after # type: ignore
to be compatible with PEP 484
This commit is contained in:
@@ -128,7 +128,7 @@ class EnumMeta(type):
|
||||
attrs['_enum_member_names_'] = member_names
|
||||
attrs['_enum_value_cls_'] = value_cls
|
||||
actual_cls = super().__new__(cls, name, bases, attrs)
|
||||
value_cls._actual_enum_cls_ = actual_cls # type: ignore - Runtime attribute isn't understood
|
||||
value_cls._actual_enum_cls_ = actual_cls # type: ignore # Runtime attribute isn't understood
|
||||
return actual_cls
|
||||
|
||||
def __iter__(cls) -> Iterator[Any]:
|
||||
@@ -678,7 +678,7 @@ class AppCommandType(Enum):
|
||||
|
||||
|
||||
def create_unknown_value(cls: Type[E], val: Any) -> E:
|
||||
value_cls = cls._enum_value_cls_ # type: ignore - This is narrowed below
|
||||
value_cls = cls._enum_value_cls_ # type: ignore # This is narrowed below
|
||||
name = f'unknown_{val}'
|
||||
return value_cls(name=name, value=val)
|
||||
|
||||
@@ -690,6 +690,6 @@ def try_enum(cls: Type[E], val: Any) -> E:
|
||||
"""
|
||||
|
||||
try:
|
||||
return cls._enum_value_map_[val] # type: ignore - All errors are caught below
|
||||
return cls._enum_value_map_[val] # type: ignore # All errors are caught below
|
||||
except (KeyError, TypeError, AttributeError):
|
||||
return create_unknown_value(cls, val)
|
||||
|
Reference in New Issue
Block a user