[commands] fix Range to allow 3.10 Union syntax

This commit is contained in:
Varun J authored and GitHub committed 2022-09-08 02:04:07 -04:00
1 parent 035dd812de
commit 75fd49e6a1
1 file changed
+3
+3
View File
@@ -1109,6 +1109,9 @@ else:
# 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')