mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
[commands] Allow commands.Range inside typing.Union or typing.Optional
This commit is contained in:
parent
cdf442bc32
commit
ce15df4275
@ -1129,6 +1129,10 @@ else:
|
|||||||
|
|
||||||
return converted
|
return converted
|
||||||
|
|
||||||
|
def __call__(self) -> None:
|
||||||
|
# Trick to allow it inside typing.Union
|
||||||
|
pass
|
||||||
|
|
||||||
def __class_getitem__(cls, obj) -> Range:
|
def __class_getitem__(cls, obj) -> Range:
|
||||||
if not isinstance(obj, tuple):
|
if not isinstance(obj, tuple):
|
||||||
raise TypeError(f'expected tuple for arguments, received {obj.__class__!r} instead')
|
raise TypeError(f'expected tuple for arguments, received {obj.__class__!r} instead')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user