Skip to content

Commit

Permalink
Fix doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Apr 2, 2024
1 parent d4c994e commit 92e30b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,11 @@ Notes:
exception when it encounters leap day because the default year used by the
parser is not a leap year. Users run into this bug every four years...

>>> strptime(f"{month_day};1984", "%m/%d;%Y") # No leap year bug.
.. doctest::

>>> month_day = "02/29"
>>> datetime.strptime(f"{month_day};1984", "%m/%d;%Y") # No leap year bug.
datetime.datetime(1984, 2, 29, 0, 0)

.. deprecated-removed:: 3.13 3.15
:meth:`~.datetime.strptime` calls using a format string containing
Expand Down

0 comments on commit 92e30b8

Please sign in to comment.