[Python-checkins] Quote literal tokens in standard format specifier grammar (GH-102902)

encukou webhook-mailer at python.org
Fri Mar 31 08:40:46 EDT 2023


https://github.com/python/cpython/commit/f6405a46627e1f74c279f712c8776a165b0ba9fd
commit: f6405a46627e1f74c279f712c8776a165b0ba9fd
branch: main
author: Petr Viktorin <encukou at gmail.com>
committer: encukou <encukou at gmail.com>
date: 2023-03-31T14:40:38+02:00
summary:

Quote literal tokens in standard format specifier grammar (GH-102902)

Reported by Damian Dureck: https://mail.python.org/archives/list/docs@python.org/thread/UZTWBJIXC3MBKTHXVTIBPGDPKBNWZ5LN/

files:
M Doc/library/string.rst

diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 3b96813e6838..5ada82732818 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -310,7 +310,7 @@ non-empty format specification typically modifies the result.
 The general form of a *standard format specifier* is:
 
 .. productionlist:: format-spec
-   format_spec: [[`fill`]`align`][`sign`][z][#][0][`width`][`grouping_option`][.`precision`][`type`]
+   format_spec: [[`fill`]`align`][`sign`]["z"]["#"]["0"][`width`][`grouping_option`]["." `precision`][`type`]
    fill: <any character>
    align: "<" | ">" | "=" | "^"
    sign: "+" | "-" | " "



More information about the Python-checkins mailing list