[Python-Dev] Replacement for print in Python 3.0 (original) (raw)
Fredrik Lundh fredrik at pythonware.com
Fri Sep 2 16:11:20 CEST 2005
- Previous message: [Python-Dev] Replacement for print in Python 3.0
- Next message: [Python-Dev] Replacement for print in Python 3.0
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Bethard wrote:
But that would be just as easy with a print() function. In the current syntax:
print 'foo:', foo, 'bar:', bar, 'baz:', baz, print 'frobble', frobble In my proposed function: print('foo:', foo, 'bar:', bar, 'baz:', baz, 'frobble', frobble) To my (admittedly biased) eyes, the second version more obviously prints to a single line.
next use case:
print 'foo:', foo, 'bar:', bar, 'baz:', baz,
if frobble > 0:
print 'frobble', frobble
else:
print 'no frobble today'
- Previous message: [Python-Dev] Replacement for print in Python 3.0
- Next message: [Python-Dev] Replacement for print in Python 3.0
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]