[Python-Dev] string formatting options and removing basestring.__mod__ (WAS: Replacement for print in Python 3.0)

Gareth McCaughan gmccaughan at synaptics-uk.com
Mon Sep 5 17:52:42 CEST 2005


I wrote:

> C++'s << operator represents another way to do formatted
> output. I regard it as an object lesson in bad design.

... and should add: Of course it's usually seen as being about
output more than about formatting, but in fact if you want
to do what Python does with "%", C with "sprintf" and
Common Lisp with (format nil ...) then the Right Thing in C++
(in so far as that exists) is usually to use << with a string
stream.

-- 
g



More information about the Python-Dev mailing list