Guido van Rossum wrote: > Over lunch we discussed putting !coercion first. IMO {foo!r:20} reads > more naturally from left to right
It also has the advantage that the common case of 'r' with no other specifications is one character shorter and looks tidier, i.e. {foo!r} rather than {foo:!r}. But either way, I suspect I'll find it difficult to avoid writing it as {foo:r} in the heat of the moment. > On 8/13/07, Talin <[EMAIL PROTECTED]> wrote: > > Where 'coercion' can be 'r' (to convert to repr()), 's' (to convert to > > string.) Is there ever a case where you would need to convert to a string? > > Originally I liked the idea of putting the type letter at the front, > > instead of at the back like it is in 2.5. However, when you think about > > it, it actually makes sense to have it at the back. I'm not so sure about that. Since most of the time it's going to be used as a discriminator that determines how the rest of the format spec is interpreted, it could make more sense to have it at the front. The only reason it's at the back in % formats is because that's the only way of telling where the format spec ends. We don't have that problem here. > > 6) Finally, Guido stressed that he wants to make sure that the > > implementation supports fields within fields, such as: > > > > {0:{1}.{2}} Is that recursive? In other words, can the nested {} contain another full format spec? -- Greg _______________________________________________ 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