Skip to content

Commit b299393

Browse files
csabellaMariatta
authored andcommitted
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
The f-string example for using datetime format specifier does not match the given output. Changed the format from %b to %B so it matches the output of "January".
1 parent c66f9f8 commit b299393

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Doc/reference/lexical_analysis.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ Some examples of formatted string literals::
676676
>>> f"result: {value:{width}.{precision}}" # nested fields
677677
'result: 12.35'
678678
>>> today = datetime(year=2017, month=1, day=27)
679-
>>> f"{today:%b %d, %Y}" # using date format specifier
679+
>>> f"{today:%B %d, %Y}" # using date format specifier
680680
'January 27, 2017'
681681
>>> number = 1024
682682
>>> f"{number:#0x}" # using integer format specifier

0 commit comments

Comments
 (0)