Add datetime __replace__ methods on 3.13+ (#12014)

This commit is contained in:
funkyrailroad
2024-05-23 11:56:09 -04:00
committed by GitHub
parent d75a47c2b7
commit 76a42727ab
2 changed files with 32 additions and 3 deletions

View File

@@ -178,11 +178,8 @@ ctypes.sizeof
ctypes.wintypes.PCHAR.from_param
ctypes.wintypes.PWCHAR.from_param
dataclasses.Field.__class_getitem__
datetime.date.__replace__
datetime.date.fromisoformat
datetime.datetime.__replace__
datetime.datetime.fromisoformat
datetime.time.__replace__
datetime.time.fromisoformat
datetime.timezone.dst
datetime.timezone.fromutc

View File

@@ -79,6 +79,9 @@ class date:
def isoformat(self) -> str: ...
def timetuple(self) -> struct_time: ...
def toordinal(self) -> int: ...
if sys.version_info >= (3, 13):
def __replace__(self, /, *, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...
def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ...
def __le__(self, value: date, /) -> bool: ...
def __lt__(self, value: date, /) -> bool: ...
@@ -148,6 +151,19 @@ class time:
def utcoffset(self) -> timedelta | None: ...
def tzname(self) -> str | None: ...
def dst(self) -> timedelta | None: ...
if sys.version_info >= (3, 13):
def __replace__(
self,
/,
*,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
fold: int = ...,
) -> Self: ...
def replace(
self,
hour: SupportsIndex = ...,
@@ -263,6 +279,22 @@ class datetime(date):
def date(self) -> _Date: ...
def time(self) -> _Time: ...
def timetz(self) -> _Time: ...
if sys.version_info >= (3, 13):
def __replace__(
self,
/,
*,
year: SupportsIndex = ...,
month: SupportsIndex = ...,
day: SupportsIndex = ...,
hour: SupportsIndex = ...,
minute: SupportsIndex = ...,
second: SupportsIndex = ...,
microsecond: SupportsIndex = ...,
tzinfo: _TzInfo | None = ...,
fold: int = ...,
) -> Self: ...
def replace(
self,
year: SupportsIndex = ...,