From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 7 Feb 2018 01:14:20 +0000 (-0800) Subject: bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5546) X-Git-Tag: v3.7.0b2~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a747cf6d9b87ea8c7ce3a42d09e5b966c8e83fa0;p=python bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5546) `arg_name` and `element_index` are defined as `digit`+ instead of `integer`. (cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119) Co-authored-by: Mariatta --- diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 9b30f8fe12..ee8ea857da 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -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: + conversion: "r" | "s" | "a" format_spec: