On 8/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > 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 > > ?
As I understand it, it's already been decided that {}-style formatting will be present in Python 3. So the question is not about the merits of {}-style formatting vs. %-style formatting. That debate's already been had. The question is whether it makes sense to keep %-style formatting around when {}-style formatting is so similar. Since %-style formatting saves at most a couple of characters per specifier, that doesn't seem to justify the massive duplication to me. STeVe -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com