Thinking about "print >>"

Neil Hodgson neilh at scintilla.org
Tue Sep 5 20:48:06 EDT 2000


Martin von Loewis wrote:
> 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.

   In the future, it may be possible to use keywords as identifiers when
there are no ambiguities. IIRC, this was introduced to JPython a while (18
months?) ago to allow access to identifiers published by Java code that
matched Python keywords. I was horrified, but the world didn't collapse
immediately. Python.Net will need something similar - its required by the
language interoperability specifications. There have been expressions of
support for extending this to CPython by some of the core developers. If its
available in two dialects of Python, it should be allowed in all.

   Neil






More information about the Python-list mailing list