mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Remove Python 3.7 branches (#11238)
This commit is contained in:
@@ -60,10 +60,8 @@ class date:
|
||||
def fromordinal(cls, __n: int) -> Self: ...
|
||||
@classmethod
|
||||
def fromisoformat(cls, __date_string: str) -> Self: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ...
|
||||
|
||||
@classmethod
|
||||
def fromisocalendar(cls, year: int, week: int, day: int) -> Self: ...
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@property
|
||||
@@ -89,26 +87,14 @@ class date:
|
||||
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: ...
|
||||
@overload
|
||||
def __sub__(self, __value: timedelta) -> Self: ...
|
||||
@overload
|
||||
def __sub__(self, __value: datetime) -> NoReturn: ...
|
||||
@overload
|
||||
def __sub__(self: _D, __value: _D) -> timedelta: ...
|
||||
else:
|
||||
# Prior to Python 3.8, arithmetic operations always returned `date`, even in subclasses
|
||||
def __add__(self, __value: timedelta) -> date: ...
|
||||
def __radd__(self, __value: timedelta) -> date: ...
|
||||
@overload
|
||||
def __sub__(self, __value: timedelta) -> date: ...
|
||||
@overload
|
||||
def __sub__(self, __value: datetime) -> NoReturn: ...
|
||||
@overload
|
||||
def __sub__(self, __value: date) -> timedelta: ...
|
||||
|
||||
def __add__(self, __value: timedelta) -> Self: ...
|
||||
def __radd__(self, __value: timedelta) -> Self: ...
|
||||
@overload
|
||||
def __sub__(self, __value: timedelta) -> Self: ...
|
||||
@overload
|
||||
def __sub__(self, __value: datetime) -> NoReturn: ...
|
||||
@overload
|
||||
def __sub__(self: _D, __value: _D) -> timedelta: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
@@ -266,17 +252,8 @@ class datetime(date):
|
||||
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls, __t: float) -> Self: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def now(cls, tz: _TzInfo | None = None) -> Self: ...
|
||||
else:
|
||||
@overload
|
||||
@classmethod
|
||||
def now(cls, tz: None = None) -> Self: ...
|
||||
@overload
|
||||
@classmethod
|
||||
def now(cls, tz: _TzInfo) -> datetime: ...
|
||||
|
||||
@classmethod
|
||||
def now(cls, tz: _TzInfo | None = None) -> Self: ...
|
||||
@classmethod
|
||||
def utcnow(cls) -> Self: ...
|
||||
@classmethod
|
||||
@@ -299,11 +276,7 @@ class datetime(date):
|
||||
*,
|
||||
fold: int = ...,
|
||||
) -> Self: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
|
||||
else:
|
||||
def astimezone(self, tz: _TzInfo | None = ...) -> datetime: ...
|
||||
|
||||
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
|
||||
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
|
||||
@classmethod
|
||||
def strptime(cls, __date_string: str, __format: str) -> Self: ...
|
||||
@@ -316,16 +289,7 @@ class datetime(date):
|
||||
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: ...
|
||||
@overload
|
||||
def __sub__(self: _D, __value: _D) -> timedelta: ...
|
||||
else:
|
||||
# Prior to Python 3.8, arithmetic operations always returned `datetime`, even in subclasses
|
||||
def __add__(self, __value: timedelta) -> datetime: ...
|
||||
def __radd__(self, __value: timedelta) -> datetime: ...
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self, __value: datetime) -> timedelta: ...
|
||||
@overload
|
||||
def __sub__(self, __value: timedelta) -> datetime: ...
|
||||
@overload # type: ignore[override]
|
||||
def __sub__(self, __value: timedelta) -> Self: ...
|
||||
@overload
|
||||
def __sub__(self: _D, __value: _D) -> timedelta: ...
|
||||
|
||||
Reference in New Issue
Block a user