Re: python strings
Thu, 21 Apr 1994 10:52:01 +0200

I wrote:

> I DO like Don Beaudry's interpretation of %(<name>)<format> as an
> extension of format strings (except I take objection to copying the
> key to an array of fixed size :-)

I still like it, but believe it would be ever so more useful if there
were a format specifier that took ANY type of object and converted it
to a string using str(). I can think of two options:

1) introduce %p (with the same options as %s) -- the mnemonic of
course means "any Python object". (In ANSI C %p means pointer but
this doesn't make sense in Python.)

2) change %s so that if its argument isn't a string it converts ot to
one using str().

What do you think?

--Guido van Rossum, CWI, Amsterdam <>
URL: <>