[issue9139] Add examples for str.format()

2010-07-02 Thread Ezio Melotti
Ezio Melotti added the comment: Committed in r82457 and r82459 (trunk), r82460 (release26-maint), r82462 (py3k), r82463 (release31-maint). Thanks for the reviews! -- resolution: accepted -> fixed stage: patch review -> committed/rejected status: open -> closed

[issue9139] Add examples for str.format()

2010-07-02 Thread Eric Smith
Eric Smith added the comment: Looks good. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python

[issue9139] Add examples for str.format()

2010-07-02 Thread Ezio Melotti
Ezio Melotti added the comment: Here is another patch. I also added another example that uses the fillchar. -- Added file: http://bugs.python.org/file17843/issue9139v3.diff ___ Python tracker __

[issue9139] Add examples for str.format()

2010-07-02 Thread Eric Smith
Eric Smith added the comment: I think I'd just delete both instances of "now". And now that I read it more critically, "position" should be "positional". How's this rewording: .. versionchanged:: 2.7 The positional argument specifiers can be omitted, so ``'{} {}'`` is equivalent to ``'{0

[issue9139] Add examples for str.format()

2010-07-02 Thread Éric Araujo
Éric Araujo added the comment: I’m not sure it’s good style to say “now” twice (in the versionchanged block). I almost feel bad pointing that there is one line with bad whitespace: + >>> for align,text in ... (Space after comma) Otherwise great patch :) -- resolution: -> accepted

[issue9139] Add examples for str.format()

2010-07-02 Thread Eric Smith
Eric Smith added the comment: This looks like a definite improvement to me. When you merge to py3k, don't forget to change the versionchanged tag to 3.1. -- ___ Python tracker _

[issue9139] Add examples for str.format()

2010-07-02 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue9139] Add examples for str.format()

2010-07-02 Thread Ezio Melotti
Ezio Melotti added the comment: Here is a new patch. I fixed the typos, removed the examples from the first section and added a link to the examples section. I also added the examples suggested by Eric plus an example about {:%}, and followed the suggestion of Éric and clarified the versioncha

[issue9139] Add examples for str.format()

2010-07-02 Thread Eric Smith
Eric Smith added the comment: Instead of "named types", I meant "named arguments", of course. -- ___ Python tracker ___ ___ Python-bug

[issue9139] Add examples for str.format()

2010-07-02 Thread Eric Smith
Eric Smith added the comment: Thanks for taking the lead on this. In this sentence: +The new format syntax also supports new and different options, showed in the +follow examples. "showed" should be "shown". I like to use an example showing attribute access on named types. Barry Warsaw sugges

[issue9139] Add examples for str.format()

2010-07-02 Thread Éric Araujo
Éric Araujo added the comment: The examples seem good to me after a quick reading. There’s not too much but still enough. I find the phrasing of the versionchanged not easily understandable: “The position of the arguments can now be omitted.” Clearer and probably too verbose: “When using numer

[issue9139] Add examples for str.format()

2010-07-01 Thread Ezio Melotti
New submission from Ezio Melotti : The attached patch adds a section with examples about str.format() after http://docs.python.org/library/string.html#format-specification-mini-language . The patch needs some small improvements: 1) the examples in the previous sections could be removed and/or