[Python-Dev] print

Paul Prescod paul@prescod.net
Sun, 23 Jul 2000 13:06:51 -0500

Lest this get (more) out of hand, I'm not proposing that print could be
deprecated in the forseeable future. We can, however, make it easier to
write to file objects (and cstring objects, and...) rather than making
print *more* of a special syntax zone than it already is. If we do our
jobs well then people may see the writeln function/method as a simpler,
more flexible alternative to print and use it of their own accord.

Fredrik Lundh wrote:
> ...
> you obviously didn't read the 10-year old post I pointed to:
>     "...everything else I could think of had other disadvantages.
>     Perhaps printing is one of these things that are important
>     enough to warrant more than one way to do things, even
>     in Python..."

I absolutely did, that's why I said: 

> > Of course it must be balanced with everything else in the guidelines,
> > but it should be a factor. 

Do you disagree????

To put it another way: you can tell me that you disagree with my
conclusions about print without stating that the guidelines I am using
to argue it are somehow inappropriate. So you balance the various
guidelines differently than I do. Fine! We can agree to that without
claiming that the other person's arguments are invalid.

Having a single, obvious way to do something is *one factor we should
keep in mind*.

Do you disagree????

In the same message you quoted, Guido admitted that his weightings are
questionable. Maybe he still stands by them. Maybe he doesn't. He sure
isn't going to get mad at me (as you are) merely for raising the
> I don't know if your recent campaign to remove things from Python is
> an attempt to compensate for all the PEP stuff, or if you really think
> Python will become easier to use if we start removing the stuff that
> makes it easy to use...
> ...but instead of speculating, I'm just going to quote someone else:

Funny, it looks like you have already speculated!

I happen to think that the print special syntax zone does not make
Python easier to use *in the long run* and I offer the following
frequently asked questions as evidence:

"How do I make print not put a newline at the end?"
"Okay, now how do I make it not put whitespace at the end?"
"Why is print a statement at all?"

and the following infrequently asked questions:

"Why can't I have a method named print?"
"Why is the syntax for writing to stdout so different from the syntax
for writing to stderr?"
"Why are the arguments to print automatically coerced but not those for
(e.g.) write?"
"Why does (e.g.) dir take parentheses but print doesn't?"
"I just want to append a few variables to a string. Why isn't it as easy
to glue them together as it is to print them out? Shouldn't the comma
insert a space?"

In REXX, the print statement would print out the names of variables that
weren't assigned yet. That made it really easy to do:

print hello world

The question is whether it made things easier for new programmers *in
the long run*. I claim no there and here. (I'm told the Amiga had the
string "Hello World" hardcoded in ROM some where :) ).

>  "I will refrain from further comments in this vein, and simply
>     place my faith in the benevolent dictator."

Two adults should be able to disagree about a Python keyword without
getting freaked out. I happen to think that part of what makes Guido a
good BDFL is that he listens to people's opinions and he isn't going to
get that if every language change proposal is shouted down as heresy,
nor if those opposed just don't contribute on principle.

 Paul Prescod - Not encumbered by corporate consensus
New from Computer Associates: "Software that can 'think', sold by 
marketers who choose not to."