Skip to content

Commit f5ad63f

Browse files
authored
datetime.rst: improve combine() docs (#101338)
The explanation on handling of datetime as the date arg was confusingly mixed with an unrelated item, and lacked proper arg name formatting.
1 parent a226278 commit f5ad63f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Doc/library/datetime.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -982,12 +982,11 @@ Other constructors, all class methods:
982982
are equal to the given :class:`.time` object's. If the *tzinfo*
983983
argument is provided, its value is used to set the :attr:`.tzinfo` attribute
984984
of the result, otherwise the :attr:`~.time.tzinfo` attribute of the *time* argument
985-
is used.
985+
is used. If the *date* argument is a :class:`.datetime` object, its time components
986+
and :attr:`.tzinfo` attributes are ignored.
986987

987988
For any :class:`.datetime` object *d*,
988-
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``. If date is a
989-
:class:`.datetime` object, its time components and :attr:`.tzinfo` attributes
990-
are ignored.
989+
``d == datetime.combine(d.date(), d.time(), d.tzinfo)``.
991990

992991
.. versionchanged:: 3.6
993992
Added the *tzinfo* argument.

0 commit comments

Comments
 (0)