mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
gh-112925: Fix error in example of datetime.time.fromisoformat and add doctest marker (GH-112931)
This commit is contained in:
parent
4e5b27e6a3
commit
bdc8d667ab
1 changed files with 3 additions and 1 deletions
|
|
@ -1799,6 +1799,8 @@ Other constructor:
|
|||
|
||||
Examples::
|
||||
|
||||
.. doctest::
|
||||
|
||||
>>> from datetime import time
|
||||
>>> time.fromisoformat('04:23:01')
|
||||
datetime.time(4, 23, 1)
|
||||
|
|
@ -1808,7 +1810,7 @@ Other constructor:
|
|||
datetime.time(4, 23, 1)
|
||||
>>> time.fromisoformat('04:23:01.000384')
|
||||
datetime.time(4, 23, 1, 384)
|
||||
>>> time.fromisoformat('04:23:01,000')
|
||||
>>> time.fromisoformat('04:23:01,000384')
|
||||
datetime.time(4, 23, 1, 384)
|
||||
>>> time.fromisoformat('04:23:01+04:00')
|
||||
datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue