mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Reverts https://github.com/python/typeshed/pull/8465 Fixes https://github.com/python/typeshed/issues/10424 Closes https://github.com/python/typeshed/pull/10425 https://github.com/python/typeshed/pull/8465 caused regressions: see https://github.com/python/typeshed/issues/10424 and https://github.com/python/mypy/issues/13800. Since it didn't fix any known problems (just some stylistic nits that we had), let's just revert the PR.
This commit is contained in:
@@ -73,6 +73,7 @@ class Decimal:
|
||||
def from_float(cls, __f: float) -> Self: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def compare(self, other: _Decimal, context: Context | None = None) -> Decimal: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def as_tuple(self) -> DecimalTuple: ...
|
||||
def as_integer_ratio(self) -> tuple[int, int]: ...
|
||||
def to_eng_string(self, context: Context | None = None) -> str: ...
|
||||
|
||||
@@ -22,6 +22,7 @@ class ReferenceType(Generic[_T]):
|
||||
__callback__: Callable[[ReferenceType[_T]], Any]
|
||||
def __new__(cls, __o: _T, __callback: Callable[[ReferenceType[_T]], Any] | None = ...) -> Self: ...
|
||||
def __call__(self) -> _T | None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ class TimerHandle(Handle):
|
||||
loop: AbstractEventLoop,
|
||||
context: Context | None = None,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def when(self) -> float: ...
|
||||
def __lt__(self, other: TimerHandle) -> bool: ...
|
||||
def __le__(self, other: TimerHandle) -> bool: ...
|
||||
|
||||
@@ -316,6 +316,7 @@ class int:
|
||||
def __float__(self) -> float: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __abs__(self) -> int: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __index__(self) -> int: ...
|
||||
|
||||
@@ -379,6 +380,7 @@ class float:
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class complex:
|
||||
@@ -418,6 +420,7 @@ class complex:
|
||||
def __neg__(self) -> complex: ...
|
||||
def __pos__(self) -> complex: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __complex__(self) -> complex: ...
|
||||
@@ -585,6 +588,7 @@ class str(Sequence[str]):
|
||||
def __ge__(self, __value: str) -> bool: ...
|
||||
def __getitem__(self, __key: SupportsIndex | slice) -> str: ...
|
||||
def __gt__(self, __value: str) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __iter__(self: LiteralString) -> Iterator[LiteralString]: ...
|
||||
@overload
|
||||
@@ -690,6 +694,7 @@ class bytes(Sequence[int]):
|
||||
def maketrans(__frm: ReadableBuffer, __to: ReadableBuffer) -> bytes: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, __key: SupportsIndex) -> int: ...
|
||||
@overload
|
||||
|
||||
@@ -35,6 +35,7 @@ class timezone(tzinfo):
|
||||
def tzname(self, __dt: datetime | None) -> str: ...
|
||||
def utcoffset(self, __dt: datetime | None) -> timedelta: ...
|
||||
def dst(self, __dt: datetime | None) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
UTC: timezone
|
||||
@@ -106,6 +107,7 @@ class date:
|
||||
@overload
|
||||
def __sub__(self, __value: date) -> timedelta: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -143,6 +145,7 @@ class time:
|
||||
def __lt__(self, __value: time) -> bool: ...
|
||||
def __ge__(self, __value: time) -> bool: ...
|
||||
def __gt__(self, __value: time) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self, timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def fromisoformat(cls, __time_string: str) -> Self: ...
|
||||
@@ -217,6 +220,7 @@ class timedelta:
|
||||
def __ge__(self, __value: timedelta) -> bool: ...
|
||||
def __gt__(self, __value: timedelta) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class datetime(date):
|
||||
min: ClassVar[datetime]
|
||||
|
||||
@@ -85,6 +85,7 @@ class Example:
|
||||
indent: int = 0,
|
||||
options: dict[int, bool] | None = None,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class DocTest:
|
||||
@@ -103,6 +104,7 @@ class DocTest:
|
||||
lineno: int | None,
|
||||
docstring: str | None,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __lt__(self, other: DocTest) -> bool: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
@@ -210,6 +212,7 @@ class DocTestCase(unittest.TestCase):
|
||||
) -> None: ...
|
||||
def runTest(self) -> None: ...
|
||||
def format_failure(self, err: str) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class SkipDocTestCase(DocTestCase):
|
||||
|
||||
@@ -34,6 +34,7 @@ class _IPAddressBase:
|
||||
class _BaseAddress(_IPAddressBase, SupportsInt):
|
||||
def __init__(self, address: object) -> None: ...
|
||||
def __add__(self, other: int) -> Self: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __sub__(self, other: int) -> Self: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
|
||||
@@ -39,6 +39,7 @@ class PurePath(PathLike[str]):
|
||||
@property
|
||||
def stem(self) -> str: ...
|
||||
def __new__(cls, *args: StrPath) -> Self: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __fspath__(self) -> str: ...
|
||||
def __lt__(self, other: PurePath) -> bool: ...
|
||||
|
||||
@@ -102,6 +102,7 @@ if sys.version_info >= (3, 8):
|
||||
def __init__(self, data: int) -> None: ...
|
||||
def __index__(self) -> int: ...
|
||||
def __reduce__(self) -> tuple[type[Self], tuple[int]]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class InvalidFileException(ValueError):
|
||||
|
||||
@@ -419,6 +419,7 @@ class Row:
|
||||
def __getitem__(self, __key: int | str) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, __key: slice) -> tuple[Any, ...]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[Any]: ...
|
||||
def __len__(self) -> int: ...
|
||||
# These return NotImplemented for anything that is not a Row.
|
||||
|
||||
@@ -113,6 +113,7 @@ if sys.version_info >= (3, 8):
|
||||
__radd__ = __add__
|
||||
def __rsub__(self, x2: float | NormalDist) -> NormalDist: ...
|
||||
__rmul__ = __mul__
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
def correlation(
|
||||
|
||||
@@ -921,6 +921,7 @@ class ForwardRef:
|
||||
def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ...
|
||||
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, other: Any) -> _SpecialForm: ...
|
||||
|
||||
Reference in New Issue
Block a user