[Python-Dev] str.format implementation (original) (raw)
Eric V. Smith eric at trueblade.com
Tue Dec 13 17:31:41 CET 2011
- Previous message: [Python-Dev] str.format implementation
- Next message: [Python-Dev] PyUnicodeObject / PyASCIIObject questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 12/12/2011 10:56 PM, Ben Wolfson wrote:
Hi,
I'm hoping to get some kind of consensus about the divergences between the implementation and documentation of str.format (http://mail.python.org/pipermail/python-dev/2011-June/111860.html and the linked bug report contain examples of the divergences). These pertain to the argname, attributename, and elementindex fields of the grammar in the docs: replacementfield ::= "{" [fieldname] ["!" conversion] [":" formatspec] "}" fieldname ::= argname ("." attributename | "[" elementindex "]")* argname ::= [identifier | integer] attributename ::= identifier elementindex ::= integer | indexstring indexstring ::= <any source character except "]"> + Nothing definitive emerged from the last round of discussion, and as far as I can recall there are now three proposals for what kind of changes might be worth making: (1) the implementation should conform to the docs;* (2) like (1) with the change that elementindex should be changed to "integer | identifier" (rendering indexstring otiose);
I've now learned what "otiose" means. Thanks!
(3) like (1) with the change that indexstring should be changed to '<any source character except "]", "}", or "{">'.
This is still on my plate. I just haven't had a lot of Python time recently. But I do plan to address this.
Eric.
- Previous message: [Python-Dev] str.format implementation
- Next message: [Python-Dev] PyUnicodeObject / PyASCIIObject questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]