[Python-checkins] bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464) (GH-5465)
Mariatta
webhook-mailer at python.org
Wed Jan 31 17:17:11 EST 2018
https://github.com/python/cpython/commit/581ce25e1ffa374e62547ef266b6326bee0c54e5
commit: 581ce25e1ffa374e62547ef266b6326bee0c54e5
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Mariatta <Mariatta at users.noreply.github.com>
date: 2018-01-31T17:17:02-05:00
summary:
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464) (GH-5465)
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".
(cherry picked from commit b299393cc372f3ecbef4304f8eaa4c7838e975ca)
Co-authored-by: Cheryl Sabella <cheryl.sabella at gmail.com>
files:
M Doc/reference/lexical_analysis.rst
diff --git a/Doc/reference/lexical_analysis.rst b/Doc/reference/lexical_analysis.rst
index 7ad83947e04a..6d093dcc2a22 100644
--- a/Doc/reference/lexical_analysis.rst
+++ b/Doc/reference/lexical_analysis.rst
@@ -676,7 +676,7 @@ Some examples of formatted string literals::
>>> f"result: {value:{width}.{precision}}" # nested fields
'result: 12.35'
>>> today = datetime(year=2017, month=1, day=27)
- >>> f"{today:%b %d, %Y}" # using date format specifier
+ >>> f"{today:%B %d, %Y}" # using date format specifier
'January 27, 2017'
>>> number = 1024
>>> f"{number:#0x}" # using integer format specifier
More information about the Python-checkins
mailing list