mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
fractions: remove _normalize, update for py312 (#10218)
This commit is contained in:
@@ -22,11 +22,9 @@ else:
|
||||
|
||||
class Fraction(Rational):
|
||||
@overload
|
||||
def __new__(
|
||||
cls, numerator: int | Rational = 0, denominator: int | Rational | None = None, *, _normalize: bool = True
|
||||
) -> Self: ...
|
||||
def __new__(cls, numerator: int | Rational = 0, denominator: int | Rational | None = None) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls, __value: float | Decimal | str, *, _normalize: bool = True) -> Self: ...
|
||||
def __new__(cls, __value: float | Decimal | str) -> Self: ...
|
||||
@classmethod
|
||||
def from_float(cls, f: float) -> Self: ...
|
||||
@classmethod
|
||||
@@ -34,6 +32,8 @@ class Fraction(Rational):
|
||||
def limit_denominator(self, max_denominator: int = 1000000) -> Fraction: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def as_integer_ratio(self) -> tuple[int, int]: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
def is_integer(self) -> bool: ...
|
||||
|
||||
@property
|
||||
def numerator(a) -> int: ...
|
||||
|
||||
@@ -407,6 +407,10 @@ pickle.Unpickler.memo # undocumented implementation detail, has different type
|
||||
re.Pattern.scanner # Undocumented and not useful. #6405
|
||||
tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class
|
||||
|
||||
# Removed undocumented and often mistakenly used _normalize parameter that was removed in 3.12
|
||||
# On 3.12, stubtest doesn't correctly combine the overload because parameter names mismatch
|
||||
fractions.Fraction.__new__
|
||||
|
||||
# Details of runtime definition don't need to be in stubs
|
||||
typing_extensions\._SpecialForm.*
|
||||
typing_extensions\.TypeVar.*
|
||||
|
||||
Reference in New Issue
Block a user