[datetime] Add missing default values (#14452)

This commit is contained in:
Semyon Moroz
2025-07-26 03:40:35 +00:00
committed by GitHub
parent 8a6075ffcc
commit 14474afb85
+24 -24
View File
@@ -118,13 +118,13 @@ class time:
resolution: ClassVar[timedelta]
def __new__(
cls,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
hour: SupportsIndex = 0,
minute: SupportsIndex = 0,
second: SupportsIndex = 0,
microsecond: SupportsIndex = 0,
tzinfo: _TzInfo | None = None,
*,
fold: int = ...,
fold: int = 0,
) -> Self: ...
@property
def hour(self) -> int: ...
@@ -144,7 +144,7 @@ class time:
def __gt__(self, value: time, /) -> bool: ...
def __eq__(self, value: object, /) -> bool: ...
def __hash__(self) -> int: ...
def isoformat(self, timespec: str = ...) -> str: ...
def isoformat(self, timespec: str = "auto") -> str: ...
@classmethod
def fromisoformat(cls, time_string: str, /) -> Self: ...
@@ -197,13 +197,13 @@ class timedelta:
resolution: ClassVar[timedelta]
def __new__(
cls,
days: float = ...,
seconds: float = ...,
microseconds: float = ...,
milliseconds: float = ...,
minutes: float = ...,
hours: float = ...,
weeks: float = ...,
days: float = 0,
seconds: float = 0,
microseconds: float = 0,
milliseconds: float = 0,
minutes: float = 0,
hours: float = 0,
weeks: float = 0,
) -> Self: ...
@property
def days(self) -> int: ...
@@ -247,13 +247,13 @@ class datetime(date):
year: SupportsIndex,
month: SupportsIndex,
day: SupportsIndex,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
hour: SupportsIndex = 0,
minute: SupportsIndex = 0,
second: SupportsIndex = 0,
microsecond: SupportsIndex = 0,
tzinfo: _TzInfo | None = None,
*,
fold: int = ...,
fold: int = 0,
) -> Self: ...
@property
def hour(self) -> int: ...
@@ -272,10 +272,10 @@ class datetime(date):
# meaning it is only *safe* to pass it as a keyword argument on 3.12+
if sys.version_info >= (3, 12):
@classmethod
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = ...) -> Self: ...
def fromtimestamp(cls, timestamp: float, tz: _TzInfo | None = None) -> Self: ...
else:
@classmethod
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = ...) -> Self: ...
def fromtimestamp(cls, timestamp: float, /, tz: _TzInfo | None = None) -> Self: ...
@classmethod
@deprecated("Use timezone-aware objects to represent datetimes in UTC; e.g. by calling .fromtimestamp(datetime.timezone.utc)")
@@ -321,8 +321,8 @@ class datetime(date):
*,
fold: int = ...,
) -> Self: ...
def astimezone(self, tz: _TzInfo | None = ...) -> Self: ...
def isoformat(self, sep: str = ..., timespec: str = ...) -> str: ...
def astimezone(self, tz: _TzInfo | None = None) -> Self: ...
def isoformat(self, sep: str = "T", timespec: str = "auto") -> str: ...
@classmethod
def strptime(cls, date_string: str, format: str, /) -> Self: ...
def utcoffset(self) -> timedelta | None: ...