diff options
author | John Belmonte <john@neggie.net> | 2023-01-26 07:25:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-26 07:25:43 (GMT) |
commit | f5ad63f79af3a5876f90b409d0c8402fa54e878a (patch) | |
tree | a91b89f37c80301ae4f856b15cc8f15a4518c555 | |
parent | a2262789abccb68a61bb4047743fbcbd9a64b13c (diff) | |
download | cpython-f5ad63f79af3a5876f90b409d0c8402fa54e878a.zip cpython-f5ad63f79af3a5876f90b409d0c8402fa54e878a.tar.gz cpython-f5ad63f79af3a5876f90b409d0c8402fa54e878a.tar.bz2 |
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.
-rw-r--r-- | Doc/library/datetime.rst | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index eba8824..ebb5f31 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -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. |