]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
datetime.rst: improve combine() docs (#101338)
authorJohn Belmonte <john@neggie.net>
Thu, 26 Jan 2023 07:25:43 +0000 (16:25 +0900)
committerGitHub <noreply@github.com>
Thu, 26 Jan 2023 07:25:43 +0000 (11:25 +0400)
The explanation on handling of datetime as the date arg was confusingly mixed with an unrelated
item, and lacked proper arg name formatting.

Doc/library/datetime.rst

index eba8824f835113ecd7bdb9b66989f20c7a1c30d7..ebb5f319efda8d8ff4a8aa21532a2add875a9f4f 100644 (file)
@@ -982,12 +982,11 @@ Other constructors, all class methods:
    are equal to the given :class:`.time` object's. If the *tzinfo*
    argument is provided, its value is used to set the :attr:`.tzinfo` attribute
    of the result, otherwise the :attr:`~.time.tzinfo` attribute of the *time* argument
-   is used.
+   is used.  If the *date* argument is a :class:`.datetime` object, its time components
+   and :attr:`.tzinfo` attributes are ignored.
 
    For any :class:`.datetime` object *d*,
-   ``d == datetime.combine(d.date(), d.time(), d.tzinfo)``. If date is a
-   :class:`.datetime` object, its time components and :attr:`.tzinfo` attributes
-   are ignored.
+   ``d == datetime.combine(d.date(), d.time(), d.tzinfo)``.
 
    .. versionchanged:: 3.6
       Added the *tzinfo* argument.