Fix several new-in-3.11 stubtest errors (#7973)

This commit is contained in:
Alex Waygood
2022-06-03 02:07:38 +01:00
committed by GitHub
parent cb9023988d
commit acc0167dc1
12 changed files with 195 additions and 85 deletions

View File

@@ -1,9 +1,10 @@
import sys
from _typeshed import Self
from collections.abc import Callable
from decimal import Decimal
from numbers import Integral, Rational, Real
from typing import Any, overload
from typing_extensions import Literal, TypeAlias
from typing_extensions import Literal, SupportsIndex, TypeAlias
_ComparableNum: TypeAlias = int | float | Decimal | Real
@@ -141,7 +142,7 @@ class Fraction(Rational):
def __copy__(self: Self) -> Self: ...
def __deepcopy__(self: Self, memo: Any) -> Self: ...
if sys.version_info >= (3, 11):
def __int__(self) -> int: ...
def __int__(self, _index: Callable[[SupportsIndex], int] = ...) -> int: ...
# Not actually defined within fractions.py, but provides more useful
# overrides
@property