print with no newline
Tim Golden
tim.golden at viacom-outdoor.co.uk
Fri Sep 3 11:00:18 EDT 2004
[Jp Calderone]
| Basically, print is only meant to help people new to the
| language get started ;)
| It often does what will make life easiest for someone who is
| just getting into things, but which is otherwise confusing, expected,
| special-casey, or otherwise undesirable. I mean, the whole
| existence of the keyword "print" is an inconsistency, right?
| One could quite reasonably expect print to be a function.
This point of view comes up from time to time on the list
and for the life of me I can't buy into it. Putting aside
the obviously tongue-in-cheek implication that only beginners
would use print, I have almost never found print to be
"confusing... or otherwise undesirable". It does exactly
what I expect it to do with the minimum of syntactic clutter.
If I want something which I consider special-casey, for example
output with no newline, then I know what my options are. And
for the most part that'll be when I'm writing out to a file,
in which case I'm almost certainly using the f.write etc.
methods of the file object.
I would *not* reasonably expect print to be a function. Why
should it be? Certainly any move to remove the print statement
from the language or to replace it by a print function would
get my thumbs-down (or whichever way round the Romans did it).
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
More information about the Python-list
mailing list