Message195221
On Wed, Aug 14, 2013 at 2:38 PM, Eric V. Smith <report@bugs.python.org>wrote:
>
> Eric V. Smith added the comment:
>
> > So what you're saying is that '{:}' is empty, but '{:10}' is not?
>
> Yes, exactly. The part before the colon says which argument to .format()
> to use. The empty string there means "use the next one". The part after the
> colon is the format specifier. In the first example above, there's an empty
> string after the colon, and in the second example there's a "10" after the
> colon.
>
> Which is why it's really easier to use:
> format(obj, '')
> and
> format(obj, '10')
> instead of .format examples. By using the built-in format, you only need
> to write the format specifier, not the ''.format() "which argument am I
> processing" stuff with the braces and colons.
>
Eric, I'd have to disagree with this part. Placing strictly formal
interpretation of "empty" aside, it seems to me unacceptable that
field-width affects the interpretation of the string. This appears more
like bug in the .format implementation than the original intention. I
suspect that at this point it may be useful to take this discussion to
pydev to get more opinions. |
|
Date |
User |
Action |
Args |
2013-08-14 21:45:05 | eli.bendersky | set | recipients:
+ eli.bendersky, barry, eric.smith, ethan.furman, serhiy.storchaka |
2013-08-14 21:45:05 | eli.bendersky | link | issue18738 messages |
2013-08-14 21:45:05 | eli.bendersky | create | |
|