mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Simplify stub for datetime.datetime (#6320)
This commit is contained in:
@@ -202,12 +202,6 @@ class datetime(date):
|
||||
fold: int = ...,
|
||||
) -> _S: ...
|
||||
@property
|
||||
def year(self) -> int: ...
|
||||
@property
|
||||
def month(self) -> int: ...
|
||||
@property
|
||||
def day(self) -> int: ...
|
||||
@property
|
||||
def hour(self) -> int: ...
|
||||
@property
|
||||
def minute(self) -> int: ...
|
||||
@@ -223,10 +217,6 @@ class datetime(date):
|
||||
def fromtimestamp(cls: Type[_S], t: float, tz: _tzinfo | None = ...) -> _S: ...
|
||||
@classmethod
|
||||
def utcfromtimestamp(cls: Type[_S], t: float) -> _S: ...
|
||||
@classmethod
|
||||
def today(cls: Type[_S]) -> _S: ...
|
||||
@classmethod
|
||||
def fromordinal(cls: Type[_S], n: int) -> _S: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def now(cls: Type[_S], tz: _tzinfo | None = ...) -> _S: ...
|
||||
@@ -244,10 +234,6 @@ class datetime(date):
|
||||
if sys.version_info >= (3, 7):
|
||||
@classmethod
|
||||
def fromisoformat(cls: Type[_S], date_string: str) -> _S: ...
|
||||
def strftime(self, fmt: str) -> str: ...
|
||||
def __format__(self, fmt: str) -> str: ...
|
||||
def toordinal(self) -> int: ...
|
||||
def timetuple(self) -> struct_time: ...
|
||||
def timestamp(self) -> float: ...
|
||||
def utctimetuple(self) -> struct_time: ...
|
||||
def date(self) -> _date: ...
|
||||
@@ -281,19 +267,13 @@ class datetime(date):
|
||||
def __lt__(self, other: datetime) -> bool: ... # type: ignore
|
||||
def __ge__(self, other: datetime) -> bool: ... # type: ignore
|
||||
def __gt__(self, other: datetime) -> bool: ... # type: ignore
|
||||
if sys.version_info >= (3, 8):
|
||||
def __add__(self: _S, other: timedelta) -> _S: ...
|
||||
def __radd__(self: _S, other: timedelta) -> _S: ...
|
||||
else:
|
||||
if sys.version_info < (3, 8):
|
||||
def __add__(self, other: timedelta) -> datetime: ...
|
||||
def __radd__(self, other: timedelta) -> datetime: ...
|
||||
@overload # type: ignore
|
||||
def __sub__(self, other: datetime) -> timedelta: ...
|
||||
@overload
|
||||
def __sub__(self, other: timedelta) -> datetime: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def weekday(self) -> int: ...
|
||||
def isoweekday(self) -> int: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def isocalendar(self) -> _IsoCalendarDate: ...
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user