STeVe> I honestly can't see the point of keeping this::
>>>> '%-10s bought %02i apples for %3.2f' % ('John', 8, 3.78)
STeVe> 'John bought 08 apples for 3.78'
STeVe> alongside this::
>>>> '{0:-10} bought {1:02i} apples for {2:3.2f}'.format('John', 8, 3.78)
STeVe> 'John bought 08 apples for 3.78'
STeVe> They're so similar I don't see why you think the latter is no
STeVe> longer "easy and powerful".
You mean other than:
* the new is more verbose than the old
* the curly braces and [012]: prefixes are just syntactic sugar when
converting old to new
* in situations where the format string isn't a literal that mechanical
translation from old to new won't be possible
* lots of people are familiar with the old format, few with the new
?
I suppose nothing.
Skip
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com