]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89039: Call subclass constructors in datetime.*.replace (GH-114780)
authorEugene Toder <eltoder@users.noreply.github.com>
Mon, 12 Feb 2024 12:44:56 +0000 (07:44 -0500)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2024 12:44:56 +0000 (14:44 +0200)
commit46190d9ea8a878a03d95b4e1bdcdc9ed576cf3fa
treebe542e7d1de6b9d033110bba25d96306ef1f1ac7
parent92483b21b30d451586c54dc4923665f7f7eedd7a
gh-89039: Call subclass constructors in datetime.*.replace (GH-114780)

When replace() method is called on a subclass of datetime, date or time,
properly call derived constructor. Previously, only the base class's
constructor was called.

Also, make sure to pass non-zero fold values when creating subclasses in
various methods. Previously, fold was silently ignored.
Lib/test/datetimetester.py
Misc/NEWS.d/next/Library/2023-12-18-20-10-50.gh-issue-89039.gqFdtU.rst [new file with mode: 0644]
Modules/_datetimemodule.c