Skip to content

Commit d9503c3

Browse files
pganssleambv
authored andcommitted
1 parent 96d37db commit d9503c3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

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)