diff options
author | Mariatta <Mariatta@users.noreply.github.com> | 2018-02-05 09:29:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 09:29:02 (GMT) |
commit | 7a561afd2c79f63a6008843b83733911d07f0119 (patch) | |
tree | 746fdfb3700b0c47b4aa4be2ea147001479300f9 /Doc/library | |
parent | d1f318105b8781b01f3507d5cb0fd841b977d5f2 (diff) | |
download | cpython-7a561afd2c79f63a6008843b83733911d07f0119.zip cpython-7a561afd2c79f63a6008843b83733911d07f0119.tar.gz cpython-7a561afd2c79f63a6008843b83733911d07f0119.tar.bz2 |
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)
`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/string.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 9b30f8f..ee8ea85 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: <any source character except "]"> + conversion: "r" | "s" | "a" format_spec: <described in the next section> |