Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ce915de

Browse filesBrowse files
committed
Update "Format String Syntax" documentation block to match actual behaviour
From discussion thread: https://discuss.python.org/t/format-string-syntax-specification-differs-from-actual-behaviour/46716/2
1 parent e7c5f60 commit ce915de
Copy full SHA for ce915de

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎Doc/library/string.rst

Copy file name to clipboardExpand all lines: Doc/library/string.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ The grammar for a replacement field is as follows:
216216
.. productionlist:: format-string
217217
replacement_field: "{" [`field_name`] ["!" `conversion`] [":" `format_spec`] "}"
218218
field_name: `arg_name` ("." `attribute_name` | "[" `element_index` "]")*
219-
arg_name: [`~python-grammar:identifier` | `~python-grammar:digit`+]
220-
attribute_name: `~python-grammar:identifier`
219+
arg_name: [`~python-grammar:digit`+ | `attribute_name`]
220+
attribute_name: <any source character except "{", "}", "[", or "."> +
221221
element_index: `~python-grammar:digit`+ | `index_string`
222222
index_string: <any source character except "]"> +
223223
conversion: "r" | "s" | "a"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.