[Python-Dev] Replacement for print in Python 3.0

Steven Bethard steven.bethard at gmail.com
Fri Sep 2 17:00:12 CEST 2005

On 9/2/05, skip at pobox.com <skip at pobox.com> wrote:
>     Steven>     print 'foo:', foo, 'bar:', bar, 'baz:', baz,
>     Steven>     print 'frobble', frobble
>     Steven> In my proposed function:
>     Steven>     print('foo:', foo, 'bar:', bar, 'baz:', baz,
>     Steven>           'frobble', frobble)
>     Steven> To my (admittedly biased) eyes, the second version more
>     Steven> obviously prints to a single line.
> Yes, you're right.  My bad.
> So, is the proposal that you would need an explicit "\n" to terminate the
> output or not?

Well, my proposal (which differs from Guidos) is that the print
function (or whatever it ends up getting called) would have the

    def print(*args):
        sys.stdout.write(' '.join(str(arg) for arg in args))

You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy

More information about the Python-Dev mailing list