mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Remove un-needed __hash__ methods from stdlib (#8465)
This commit is contained in:
@@ -74,7 +74,6 @@ class Decimal:
|
||||
def from_float(cls: type[Self], __f: float) -> Self: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def compare(self, other: _Decimal, context: Context | 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 = ...) -> str: ...
|
||||
|
||||
@@ -23,7 +23,6 @@ class ReferenceType(Generic[_T]):
|
||||
__callback__: Callable[[ReferenceType[_T]], Any]
|
||||
def __new__(cls: type[Self], 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: ...
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ class TimerHandle(Handle):
|
||||
loop: AbstractEventLoop,
|
||||
context: Context | None = ...,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def when(self) -> float: ...
|
||||
def __lt__(self, other: TimerHandle) -> bool: ...
|
||||
def __le__(self, other: TimerHandle) -> bool: ...
|
||||
|
||||
@@ -296,7 +296,6 @@ 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: ...
|
||||
|
||||
@@ -360,7 +359,6 @@ class float:
|
||||
def __int__(self) -> int: ...
|
||||
def __float__(self) -> float: ...
|
||||
def __abs__(self) -> float: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
|
||||
class complex:
|
||||
@@ -402,7 +400,6 @@ 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: ...
|
||||
@@ -564,7 +561,6 @@ class str(Sequence[str]):
|
||||
def __ge__(self, __x: str) -> bool: ...
|
||||
def __getitem__(self, __i: SupportsIndex | slice) -> str: ...
|
||||
def __gt__(self, __x: str) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __iter__(self: LiteralString) -> Iterator[LiteralString]: ...
|
||||
@overload
|
||||
@@ -674,7 +670,6 @@ class bytes(ByteString):
|
||||
def maketrans(__frm: ReadableBuffer, __to: ReadableBuffer) -> bytes: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __iter__(self) -> Iterator[int]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
@overload
|
||||
def __getitem__(self, __i: SupportsIndex) -> int: ...
|
||||
@overload
|
||||
|
||||
@@ -29,7 +29,6 @@ class timezone(tzinfo):
|
||||
min: ClassVar[timezone]
|
||||
max: ClassVar[timezone]
|
||||
def __init__(self, offset: timedelta, name: str = ...) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
UTC: timezone
|
||||
@@ -94,7 +93,6 @@ class date:
|
||||
@overload
|
||||
def __sub__(self, __other: date) -> timedelta: ...
|
||||
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
@@ -132,7 +130,6 @@ class time:
|
||||
def __lt__(self, __other: time) -> bool: ...
|
||||
def __ge__(self, __other: time) -> bool: ...
|
||||
def __gt__(self, __other: time) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self, timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def fromisoformat(cls: type[Self], __time_string: str) -> Self: ...
|
||||
@@ -200,7 +197,6 @@ class timedelta(SupportsAbs[timedelta]):
|
||||
def __ge__(self, __other: timedelta) -> bool: ...
|
||||
def __gt__(self, __other: timedelta) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
class datetime(date):
|
||||
min: ClassVar[datetime]
|
||||
|
||||
@@ -85,7 +85,6 @@ class Example:
|
||||
indent: int = ...,
|
||||
options: dict[int, bool] | None = ...,
|
||||
) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class DocTest:
|
||||
@@ -104,7 +103,6 @@ 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: ...
|
||||
|
||||
@@ -211,7 +209,6 @@ class DocTestCase(unittest.TestCase):
|
||||
def format_failure(self, err: str) -> str: ...
|
||||
def debug(self) -> None: ...
|
||||
def id(self) -> str: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def shortDescription(self) -> str: ...
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ class _IPAddressBase:
|
||||
class _BaseAddress(_IPAddressBase, SupportsInt):
|
||||
def __init__(self, address: object) -> None: ...
|
||||
def __add__(self: Self, other: int) -> Self: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __int__(self) -> int: ...
|
||||
def __sub__(self: Self, other: int) -> Self: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
|
||||
@@ -38,7 +38,6 @@ class PurePath(PathLike[str]):
|
||||
@property
|
||||
def stem(self) -> str: ...
|
||||
def __new__(cls: type[Self], *args: StrPath) -> Self: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __fspath__(self) -> str: ...
|
||||
def __lt__(self, other: PurePath) -> bool: ...
|
||||
|
||||
@@ -99,7 +99,6 @@ if sys.version_info >= (3, 8):
|
||||
def __init__(self, data: int) -> None: ...
|
||||
def __index__(self) -> int: ...
|
||||
def __reduce__(self: Self) -> tuple[type[Self], tuple[int]]: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
class InvalidFileException(ValueError):
|
||||
|
||||
@@ -420,7 +420,6 @@ class Row:
|
||||
def __getitem__(self, __index: int | str) -> Any: ...
|
||||
@overload
|
||||
def __getitem__(self, __index: 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,7 +113,6 @@ 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, 10):
|
||||
def correlation(__x: Sequence[_Number], __y: Sequence[_Number]) -> float: ...
|
||||
|
||||
@@ -813,7 +813,6 @@ 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