mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-02 00:00:02 +00:00
[commands] fix Range to allow 3.10 Union syntax
This commit is contained in:
parent
035dd812de
commit
75fd49e6a1
@ -1109,6 +1109,9 @@ else:
|
|||||||
# Trick to allow it inside typing.Union
|
# Trick to allow it inside typing.Union
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def __or__(self, rhs) -> Any:
|
||||||
|
return Union[self, rhs]
|
||||||
|
|
||||||
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