mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Use PEP 585 syntax in @python2/_ast, convert more TypeVars to _typeshed.Self, & # noqa a SQLAlchemy line (#6954)
* Manual fixes for `_ast` and `SQLAlchemy` * Change more `TypeVar`s to `Self`, using script
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from _typeshed import Self
|
||||
from decimal import Decimal
|
||||
from numbers import Integral, Rational, Real
|
||||
from typing import TypeVar, Union, overload
|
||||
from typing import Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
_ComparableNum = Union[int, float, Decimal, Real]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@overload
|
||||
def gcd(a: int, b: int) -> int: ...
|
||||
@@ -18,10 +18,10 @@ def gcd(a: Integral, b: Integral) -> Integral: ...
|
||||
class Fraction(Rational):
|
||||
@overload
|
||||
def __new__(
|
||||
cls: type[_T], numerator: int | Rational = ..., denominator: int | Rational | None = ..., *, _normalize: bool = ...
|
||||
) -> _T: ...
|
||||
cls: type[Self], numerator: int | Rational = ..., denominator: int | Rational | None = ..., *, _normalize: bool = ...
|
||||
) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls: type[_T], __value: float | Decimal | str, *, _normalize: bool = ...) -> _T: ...
|
||||
def __new__(cls: type[Self], __value: float | Decimal | str, *, _normalize: bool = ...) -> Self: ...
|
||||
@classmethod
|
||||
def from_float(cls, f: float) -> Fraction: ...
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user