Browse Source

[commands] fix Range to allow 3.10 Union syntax

pull/10109/head
Varun J 3 years ago
committed by dolfies
parent
commit
f31377ccda
  1. 7
      discord/ext/commands/converter.py

7
discord/ext/commands/converter.py

@ -1096,6 +1096,13 @@ else:
return converted
def __call__(self) -> None:
# Trick to allow it inside typing.Union
pass
def __or__(self, rhs) -> Any:
return Union[self, rhs]
def __class_getitem__(cls, obj) -> Range:
if not isinstance(obj, tuple):
raise TypeError(f'expected tuple for arguments, received {obj.__class__!r} instead')

Loading…
Cancel
Save