]> granicus.if.org Git - python/commitdiff
bpo-32735: Fix typo in f-strings datetime format specifier example (GH-5464)
authorCheryl Sabella <cheryl.sabella@gmail.com>
Wed, 31 Jan 2018 21:37:51 +0000 (16:37 -0500)
committerMariatta <Mariatta@users.noreply.github.com>
Wed, 31 Jan 2018 21:37:51 +0000 (16:37 -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".

Doc/reference/lexical_analysis.rst

index 95b0f53a83e6042e09eb12bcd7f5dcbaddffd459..c6d96ca612b8c386e85e33e5b68b401cd0f7222a 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