[Python-Dev] Challenge about print >> None

Vladimir Marangozov Vladimir.Marangozov@inrialpes.fr
Fri, 8 Sep 2000 15:47:08 +0200 (CEST)


Seems like people are very surprised to see "print >> None" defaulting
to "print >> sys.stderr". I must confess that now that I'm looking at
it and after reading the PEP, this change lacks some argumentation.

In Python, this form surely looks & feels like the Unix cat /dev/null,
that is, since None doesn't have a 'write' method, the print statement
is expected to either raise an exception or be specialized for None to mean
"the print statement has no effect". The deliberate choice of sys.stderr
is not obvious.

I understand that Guido wanted to say "print >> None, args == print args"
and simplify the script logic, but using None in this case seems like a
bad spelling <wink>.

I have certainly carefully avoided any debates on the issue as I don't
see myself using this feature any time soon, but when I see on c.l.py
reactions of surprise on weakly argumented/documented features and I
kind of feel the same way, I'd better ask for more arguments here myself.

-- 
       Vladimir MARANGOZOV          | Vladimir.Marangozov@inrialpes.fr
http://sirac.inrialpes.fr/~marangoz | tel:(+33-4)76615277 fax:76615252