Skip to content

Commit c9d4fc2

Browse files
Apply suggestions from code review
Co-authored-by: Stan Ulbrych <[email protected]>
1 parent 3e883c9 commit c9d4fc2

File tree

3 files changed

+9
-11
lines changed

3 files changed

+9
-11
lines changed

Doc/library/datetime.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Instance methods:
788788
>>> date(2002, 12, 4).isoformat(basic=True)
789789
'20021204'
790790

791-
.. versionchanged:: 3.14
791+
.. versionchanged:: next
792792
Added the *basic* parameter.
793793

794794

@@ -1622,7 +1622,7 @@ Instance methods:
16221622
.. versionchanged:: 3.6
16231623
Added the *timespec* parameter.
16241624

1625-
.. versionadded:: 3.14
1625+
.. versionadded:: next
16261626
Added the *basic* parameter.
16271627

16281628

@@ -1985,12 +1985,7 @@ Instance methods:
19851985
- ``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not return ``None``
19861986
- ``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:`utcoffset` does not return ``None``
19871987

1988-
If *basic* is true, this uses the ISO 8601 basic format, one of:
1989-
1990-
- ``HHMMSS``
1991-
- ``HHMMSS.ffffff``
1992-
- ``HHMMSS+HHMM[SS[.ffffff]]``
1993-
- ``HHMMSS.ffffff+HHMM[SS[.ffffff]]``
1988+
If *basic* is true, this uses the ISO 8601 basic format which omits the colons.
19941989

19951990
The optional argument *timespec* specifies the number of additional
19961991
components of the time to include (the default is ``'auto'``).
@@ -2026,7 +2021,7 @@ Instance methods:
20262021
.. versionchanged:: 3.6
20272022
Added the *timespec* parameter.
20282023

2029-
.. versionchanged:: 3.14
2024+
.. versionchanged:: next
20302025
Added the *basic* parameter.
20312026

20322027

Doc/whatsnew/3.14.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ datetime
435435

436436
(Contributed by Bénédikt Tran in :gh:`118948`.)
437437

438+
438439
os
439440
--
440441

Lib/_pydatetime.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,9 @@ def __hash__(self):
15701570
# Conversion to string
15711571

15721572
def _tzstr(self, basic):
1573-
"""Return formatted timezone offset (+xx:xx) or an empty string."""
1573+
"""Return formatted timezone offset (+xx:xx) or an empty string.
1574+
The colon separator is omitted if *basic* is true.
1575+
"""
15741576
off = self.utcoffset()
15751577
sep = '' if basic else ':'
15761578
return _format_offset(off, sep)
@@ -1600,7 +1602,7 @@ def isoformat(self, timespec='auto', basic=False):
16001602
The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
16011603
part is omitted if self.microsecond == 0.
16021604
1603-
If *basic* is true, separators ':' are removed from the output.
1605+
If *basic* is true, separators ':' are omitted.
16041606
16051607
The optional argument timespec specifies the number of additional
16061608
terms of the time to include. Valid options are 'auto', 'hours',

0 commit comments

Comments
 (0)