Add __int__ to Fraction in Python 3.11 (#6372)

This commit is contained in:
Pavel Karateev
2021-11-24 17:59:08 +03:00
committed by GitHub
parent a9cfd23fc3
commit 7df997c6c0

View File

@@ -134,6 +134,8 @@ class Fraction(Rational):
def __le__(self, other: _ComparableNum) -> bool: ...
def __ge__(self, other: _ComparableNum) -> bool: ...
def __bool__(self) -> bool: ...
if sys.version_info >= (3, 11):
def __int__(self) -> int: ...
# Not actually defined within fractions.py, but provides more useful
# overrides
@property