Thinking about "print >>"
Alex Martelli
aleaxit at yahoo.com
Tue Sep 5 18:07:41 EDT 2000
"Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote in message
news:p6qya16n7so.fsf at informatik.hu-berlin.de...
> Roy Smith <roy at popmail.med.nyu.edu> writes:
>
> > It seems to me that the thing to do would be to define a "print" method
> > for file objects, which is like write, but has all the pretty-print
> > functionality of the print statement.
>
> Yet another proposal that doesn't work. print is a keyword, so you
> can't use it as a method name.
Have you noticed the quote characters Roy carefully placed around the
word 'print'? One reason quotes are used in English is to imply "...so
to speak", i.e., not-literally. In Roy's sentence that you quote, in other
words, there is no implication that the method be named by the 5-letter
string 'print'; on the contrary, its form affords an inference that he
thinks it would be otherwise-named.
The exact name matters far less than the semantics -- be it println,
Print, writeln, whatever. By almost any halfway-sensible name, it
would have been a far better idea than the 'print>>' blotch, though
not (in my humble but considered opinion) quite as good as a function
(builtin, or in the sys module), which would more easily have
extended to file-_like_ objects.
This is all moot, since the BDFL has decided and 'print>>' is thus
in the language despite whatever objections we could raise. But
in a language with as few blotches as Python, seeing one so ugly,
albeit in a little corner of the language, born right before our eyes
(despite all the sensible, workable, excellent proposals against it
seen on this group -- the BDFL deigned to answer once, partially,
and took no further notice of any observation) was so horrifying
an experience that it will take a long while before our collective
memory can let it go.
Alex
More information about the Python-list
mailing list