[Python-3000] print() parameters in py3k

Fredrik Lundh fredrik at pythonware.com
Thu Nov 23 15:13:43 CET 2006


George Sakkis wrote:

> a. Will print have to do an isinstance(args[0], format) to decide what
> to do ? If so, don't the usual arguments for duck typing and against
> type checking apply here ?

isinstance (or an equivalent mechanism) would be more robust, in this
specific case.

> b. print(a,b,c) is no longer obvious whether it prints 3 unformatted
> objects or 2 formatted, if you don't know what a is.

nope, but on the other hand, you don't know what it prints today either
(see my other post).

> b. What if for some reason one actually wants to print the format
> object instead of interpreting as a format specifier ?

repr() is your friend.

</F> 





More information about the Python-3000 mailing list