Ben Wolfson added the comment:

"My own preference is to let this quote from PEP 3101 dominate the behaviour: 
"The rules for parsing an item key are very simple. If it starts with a digit, 
then it is treated as a number, otherwise it is used as a string."

That means Petri's suggested solution (allowing any character except a closing 
square bracket and braces in the item key) sounds good to me."

But ... that isn't what the quotation from the PEP says, since it doesn't 
exclude braces. I also don't really see why the PEP should be given much 
authority in this issue, since it pays extremely cursory attention to this part 
of the format.

In any case, judging by the filename and description (god knows I can't 
remember, having written it nine months ago), strformat-no-braces.diff 
implements that behavior. (Oh, now I see from an earlier comment of mine that 
that is, in fact, what it does.)

Meanwhile, it was five months ago that Eric Smith said "It's on my list of 
things to look at. I have a project due next week, then I'll have some time."

I understand that this is not the biggest deal, but the patch is also pretty 
compact and (I think) easily understood. Petri seemed to think it was mostly ok 
in May 2012, when, IIRC, several people on python-dev agreed that the current 
behavior should be changed. God only knows how unicode_format.h has changed in 
the interim. Peer review for academic papers moves substantially faster than 
this.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12014>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to