summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-02-12 08:07:55 (GMT)
committerGitHub <noreply@github.com>2018-02-12 08:07:55 (GMT)
commit6708be744d032aeffab3e2cf0b064a41a719d8a1 (patch)
tree35b1db6c075dba56ab4d02f7de14628a1f733f1b /Doc
parent743b6c07e8c79ffee38ab77f1284b542d865ce6e (diff)
downloadcpython-6708be744d032aeffab3e2cf0b064a41a719d8a1.zip
cpython-6708be744d032aeffab3e2cf0b064a41a719d8a1.tar.gz
cpython-6708be744d032aeffab3e2cf0b064a41a719d8a1.tar.bz2
bpo-32720: Fixed the replacement field grammar documentation. (GH-5544) (GH-5547)
`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>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/string.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index dbafb48..706d5e1 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>