[commands] Add __repr__ to Range

This commit is contained in:
Rapptz 2022-09-08 02:06:36 -04:00
parent 75fd49e6a1
commit 9971c2e09a

View File

@ -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')