]> granicus.if.org Git - python/commitdiff
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5547)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 12 Feb 2018 08:07:55 +0000 (00:07 -0800)
committerGitHub <noreply@github.com>
Mon, 12 Feb 2018 08:07:55 +0000 (00:07 -0800)
`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)

Co-authored-by: Mariatta <Mariatta@users.noreply.github.com>
Doc/library/string.rst

index dbafb48a80546a1ca683724f8f595358e6766d4b..706d5e1fff3f33e87ba394bced459db5d5b66e20 100644 (file)
@@ -202,9 +202,9 @@ The grammar for a replacement field is as follows:
    .. productionlist:: sf
       replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
       field_name: arg_name ("." `attribute_name` | "[" `element_index` "]")*
-      arg_name: [`identifier` | `integer`]
+      arg_name: [`identifier` | `digit`+]
       attribute_name: `identifier`
-      element_index: `integer` | `index_string`
+      element_index: `digit`+ | `index_string`
       index_string: <any source character except "]"> +
       conversion: "r" | "s" | "a"
       format_spec: <described in the next section>