Skip to content

[datetime] Add missing default values #14452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions stdlib/datetime.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -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: ...

Expand Down Expand Up @@ -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: ...
Expand Down Expand Up @@ -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: ...
Expand All @@ -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)")
Expand Down Expand Up @@ -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: ...
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy