Message216038
The doc bug is that the grammar block uses 'integer' (linked to https://docs.python.org/3/reference/lexical_analysis.html#grammar-token-integer) in
arg_name ::= [identifier | integer]
element_index ::= integer | index_string
when it should use 'decimalinteger' or even more exactly 'digit+'. The int() builtin uses the same relaxed rule when no base is given.
>>> 011
SyntaxError: invalid token
>>> int('011')
11
>>> '{[011]}'.format('abcdefghijlmn')
'm'
One possibity is to replace 'integer' in the grammar block with 'digit+' and perhaps leave the text alone. Another is to replace 'integer' with 'index_number', to go with 'index_string, and add the production "index_number ::= digit+". My though for the latter is that 'index_number' would connect better with 'number' as used in the text. A further option would be to actually replace 'number' in the text with 'index_number'.
PS to Todd. As much as possible, doc content changes should be separated from re-formatting. I believe the first block of your patch is purely a re-format |
|
Date |
User |
Action |
Args |
2014-04-13 23:43:30 | terry.reedy | set | recipients:
+ terry.reedy, rhettinger, mark.dickinson, eric.smith, kisielk, eric.araujo, mrabarnett, flox, docs@python, gosella, Todd.Rovito |
2014-04-13 23:43:30 | terry.reedy | set | messageid: <1397432610.84.0.465837716319.issue7951@psf.upfronthosting.co.za> |
2014-04-13 23:43:30 | terry.reedy | link | issue7951 messages |
2014-04-13 23:43:30 | terry.reedy | create | |
|