Skip to content

Commit d9503c3

Browse files
pganssleambv
authored andcommitted
Add What's New entry for date subclass behavior (#11790)
This was a backwards incompatible change and should be clearly noted. Related bugs: bpo-32417: https://bugs.python.org/issue32417 bpo-35364: https://bugs.python.org/issue35364
1 parent 96d37db commit d9503c3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ Other Language Changes
115115
a :exc:`SyntaxWarning` instead.
116116
(Contributed by Serhiy Storchaka in :issue:`32912`.)
117117

118+
* Arithmetic operations between subclasses of :class:`datetime.date` or
119+
:class:`datetime.datetime` and :class:`datetime.timedelta` objects now return
120+
an instance of the subclass, rather than the base class. This also affects
121+
the return type of operations whose implementation (directly or indirectly)
122+
uses :class:`datetime.timedelta` arithmetic, such as
123+
:meth:`datetime.datetime.astimezone`.
124+
(Contributed by Paul Ganssle in :issue:`32417`.)
125+
118126

119127
New Modules
120128
===========

0 commit comments

Comments
 (0)