PEP 214, extended print statement
Thomas Wouters
thomas at xs4all.net
Thu Aug 17 10:31:54 EDT 2000
On Thu, Aug 17, 2000 at 06:08:18AM +0000, Al-Amerrho H. Amerin wrote:
> Doesn't this look much better and more intuitive ( my subjective opinion ) ?
> print 'this message goes to my log file' >> mylogfile
> a-la shell script.
Well, no, because Python is not a shell script :-) It's also not possible,
because then Python would not be able to tell the difference between
print (something) >> outfile
(print 'something' to 'outfile')
and
print (something >> outfile)
(shift 'something' right by 'outfile' bits, and print the result)
'>>' is already a legal operator ! But currently 'print >> something' isn't
a legal expression, because you can't operate on a statement.
> I'm sorry if this has been discussed before...
Not at all. You're missing the point of a PEP! If it has been discussed
before, it should be mentioned in the PEP itself -- that's what it's for.
--
Thomas Wouters <thomas at xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
More information about the Python-list
mailing list