[issue5237] Allow auto-numbered replacement fields in str.format() strings
Terry J. Reedy
report at bugs.python.org
Sat Mar 14 22:30:57 CET 2009
Terry J. Reedy <tjreedy at udel.edu> added the comment:
Either Brandl or Peterson can and typically will change the .rst source
if given the exact new text. For me to write that, I need to know the
grammar you actually implemented. Did you, in essence, simply change
field_name ::= (identifier | integer) ("." attribute_name | "["
element_index "]")*
to (in essence)
field_name ::= (identifier | integer | ) ("." attribute_name |
"[" element_index "]")*
with the proviso that integers and blanks not be mixed in the same
string, so that{.attr} and {[dex]} become legal? Or are those still
illegal because only totally blank field names are allowed, so that the
new field_name rule is essentially
field_name ::= ((identifier | integer) ("." attribute_name | "["
element_index "]")*) | ( )
(with the same proviso).
The existing doc text after the grammar box is slightly ambiguous or
contradictory in that it first says that field names *are* ints or names
and then says, correctly, that they *begin* with an int or name. (I
would like to fix this in addition to adding a sentence.) Hence 'blank
field name' can have two slightly different meanings and hence the
question above.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5237>
_______________________________________
More information about the Python-bugs-list
mailing list