[Python-Dev] Replacement for print in Python 3.0 (original) (raw)

Gareth McCaughan gmccaughan at synaptics-uk.com
Fri Sep 2 13:14:11 CEST 2005


We scientists still use these for debugging. We never 'move on' very far from the tutorial. The salient feature about print statements is that they live to be put in and commented out 10 minutes later, without some import being required or other enabling object being around.

Easy things should be easy. Hard things should be possible. I don't believe the person who said the trailing comma case mixed up anybody, not for more than 10 seconds anyway.

Damn right. No, I mean: damn "write" :-).

I've used Python for teaching beginner programmers, for quick-hack scripts, for interactive diddling about, for scientific computation, for algorithmic experimentation, for GUI applications. I'd appreciably miss "print" for all of these, even the last. (My GUI applications sometimes have bugs. How about yours?)

So far as I can see, two arguments against "print" have been proposed.

  1. It has some ugly features, like the trailing-comma hack.

  2. It's a statement that does something "ordinary" and could be replaced by a function.

Against which, we have

  1. It's convenient for debugging, interactive use, simple scripts, and various other things.

  2. It's beginner-friendly.

Now, I'm sure I remember hearing something that was relevant to this. "Pragmatism beats purification"? No, that's not quite it. "Practice beats perfection?" No. Ah yes, I remember: "Practicality beats purity". But, of course, that wasn't talking about Python 3000. :-)

-- g



More information about the Python-Dev mailing list