mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Stdlib: add many missing __hash__ and __eq__ methods (#10464)
This commit is contained in:
@@ -36,6 +36,7 @@ class timezone(tzinfo):
|
||||
def utcoffset(self, __dt: datetime | None) -> timedelta: ...
|
||||
def dst(self, __dt: datetime | None) -> None: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
UTC: timezone
|
||||
@@ -87,6 +88,7 @@ class date:
|
||||
def __lt__(self, __value: date) -> bool: ...
|
||||
def __ge__(self, __value: date) -> bool: ...
|
||||
def __gt__(self, __value: date) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __add__(self, __value: timedelta) -> Self: ...
|
||||
def __radd__(self, __value: timedelta) -> Self: ...
|
||||
@@ -145,6 +147,7 @@ class time:
|
||||
def __lt__(self, __value: time) -> bool: ...
|
||||
def __ge__(self, __value: time) -> bool: ...
|
||||
def __gt__(self, __value: time) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def isoformat(self, timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
@@ -219,6 +222,7 @@ class timedelta:
|
||||
def __lt__(self, __value: timedelta) -> bool: ...
|
||||
def __ge__(self, __value: timedelta) -> bool: ...
|
||||
def __gt__(self, __value: timedelta) -> bool: ...
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
|
||||
@@ -310,6 +314,8 @@ class datetime(date):
|
||||
def __lt__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __ge__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __gt__(self, __value: datetime) -> bool: ... # type: ignore[override]
|
||||
def __eq__(self, __value: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self, __value: timedelta) -> Self: ...
|
||||
|
||||
Reference in New Issue
Block a user