On Sat, 2005-09-03 at 22:08, Nick Coghlan wrote: > > See a (very quick and very dirty ;) strawman that I just posted to the > > wiki. I think this has some interesting semantics, including the > > ability to control the separator inline in a C++-like fashion. The > > writef() version also accepts string.Templates or %s-strings as its > > first argument. I'm not sure I like reserving 'to' and 'nl' keyword > > arguments, and not having the ability to print Separator instances > > directly, but OTOH maybe those aren't big deals. > > The latter problem is easily solved by calling str() at the point of the call > so that write() never sees the actual Separator object.
Good point. > However, this 'inline' > behaviour modification has always annoyed me in C++ - if you want this kind of > control over the formatting, a format string is significantly clearer. You're probably right about that. > Separating the formatting out into a separate functions like this addresses > your concern with the namespace conflict for 'to' and 'nl', and also makes the > 'format' builtin more generally useful, as it can be used for cases other than > direct output to a stream. The downside being that you have to type more to get the behavior you want. It does have the advantage of solving the namespace problem. -Barry
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com