]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-124832: Add a note to indicate that `datetime.now` may return the same...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 8 Oct 2024 18:27:50 +0000 (20:27 +0200)
committerGitHub <noreply@github.com>
Tue, 8 Oct 2024 18:27:50 +0000 (18:27 +0000)
gh-124832: Add a note to indicate that `datetime.now` may return the same instant (GH-124834)

* Update datetime.rst

* Update datetime.rst

replace warning with note

* Update Doc/library/datetime.rst

* Update Doc/library/datetime.rst

---------

(cherry picked from commit 760b1e103a0aa696cdf448e0d500cd1bac2213fa)

Co-authored-by: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Doc/library/datetime.rst

index 8f5ea47da0db252b9960b3502a06dcae663eff9a..671554f2cf3d0d881cc551e850e862a5d7146a64 100644 (file)
@@ -896,6 +896,10 @@ Other constructors, all class methods:
 
    This function is preferred over :meth:`today` and :meth:`utcnow`.
 
+   .. note::
+
+      Subsequent calls to :meth:`!datetime.now` may return the same
+      instant depending on the precision of the underlying clock.
 
 .. classmethod:: datetime.utcnow()