A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-September/055993.html below:

[Python-Dev] Replacement for print in Python 3.0

[Python-Dev] Replacement for print in Python 3.0Steven Bethard steven.bethard at gmail.com
Thu Sep 1 22:23:28 CEST 2005
[Guido van Rossum]
> And good riddance! The print statement harks back to ABC and even
> (unvisual) Basic. Out with it!

[Barry Warsaw]
> I have to strongly disagree.  The print statement is simple, easy to
> understand, and easy to use.

[Paul Moore]
> I agree with Barry. In particular, the behaviour of adding spaces
> between items is something I find very useful, and it's missing from
> the functional forms.

While I agree that mostly the print statement is "simple, easy to
understand, and easy to use", I've seen the trailing-comma version
cause confusion for a lot of newbies.  I wouldn't mind at all if the
trailing-comma version disappeared in Python 3.0 -- if you need this
kind of complicated output, you can always use sys.stdout.write and/or
string formatting.

The spaces-between-items point that Paul Moore makes is IMHO the best
argument against the proposed write*() functions.  I think we *do*
need a statement or function of some sort that does the most basic
task: writing a line to sys.stdout that calls str() on each of the
elements and joins them with spaces.  That is, I think we need to keep
*something* with functionality like:

    def XXX(*args):
        sys.stdout.write('%s\n' % ' '.join(str(a) for a in args))

Note that this would keep the Hello World example simple:

    XXX(greeting, name)

STeVe
-- 
You can wordify anything if you just verb it.
        --- Bucky Katt, Get Fuzzy
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4