From 72275a73facff143a2c39f3e07d4c953fa8d21a5 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Tue, 6 Apr 2021 07:35:02 -0400 Subject: [PATCH] Use non-underscore TypeVar in enum code --- discord/enums.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index 283a5ded7..ac83c13f7 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -426,14 +426,14 @@ class InteractionType(Enum): ping = 1 application_command = 2 -_T = TypeVar('_T') +T = TypeVar('T') -def create_unknown_value(cls: Type[_T], val: Any) -> _T: +def create_unknown_value(cls: Type[T], val: Any) -> T: value_cls = cls._enum_value_cls_ # type: ignore name = f'unknown_{val}' return value_cls(name=name, value=val) -def try_enum(cls: Type[_T], val: Any) -> _T: +def try_enum(cls: Type[T], val: Any) -> T: """A function that tries to turn the value into enum ``cls``. If it fails it returns a proxy invalid value instead.