]> granicus.if.org Git - python/commitdiff
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464) (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 31 Jan 2018 22:17:02 +0000 (14:17 -0800)
committerMariatta <Mariatta@users.noreply.github.com>
Wed, 31 Jan 2018 22:17:02 +0000 (17:17 -0500)
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@gmail.com>
Doc/reference/lexical_analysis.rst

index 7ad83947e04aae37146217d277a528edc2b97b83..6d093dcc2a221927d0e4516d00f4b408cce2cfe0 100644 (file)
@@ -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