Browse Source

[commands] Allow commands.Range inside typing.Union or typing.Optional

pull/7888/head
Rapptz 3 years ago
parent
commit
ce15df4275
  1. 4
      discord/ext/commands/converter.py

4
discord/ext/commands/converter.py

@ -1129,6 +1129,10 @@ else:
return converted
def __call__(self) -> None:
# Trick to allow it inside typing.Union
pass
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