mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-12 08:49:48 +00:00
[commands] Add __repr__ to Range
This commit is contained in:
parent
75fd49e6a1
commit
9971c2e09a
@ -1112,6 +1112,9 @@ else:
|
|||||||
def __or__(self, rhs) -> Any:
|
def __or__(self, rhs) -> Any:
|
||||||
return Union[self, rhs]
|
return Union[self, rhs]
|
||||||
|
|
||||||
|
def __repr__(self) -> str:
|
||||||
|
return f'{self.__class__.__name__}[{self.annotation.__name__}, {self.min}, {self.max}]'
|
||||||
|
|
||||||
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