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/056249.html below:

[Python-Dev] Replacement for print in Python 3.0

[Python-Dev] Replacement for print in Python 3.0Trent Mick trentm at ActiveState.com
Tue Sep 6 20:02:44 CEST 2005
[Barry Warsaw wrote]
> Also, we already have precedence in format+print in the logging
> package.  I actually think the logging provides a nice, fairly to use
> interface that print-ng can be modeled on.

The main reason for doing that in the logging package is for
performance: processing the args into the format string can be deferred
until the logging system knows that the log message will actually be
used.  I'm not saying that the separation of 'fmt' and args in the
logging methods doesn't have the other benefit of clarity:

    log.debug("%s %s %s %s ...", arg1, arg2, arg3,
              really_really_long_arg4,)                      # nicer
    log.debug("%s %s %s %s ..." % (arg1, arg2, arg3,
                                   really_really_long_arg4)) # icky

but the performance reason doesn't apply to the printf()/write()
discussion here.

Trent

-- 
Trent Mick
TrentM at ActiveState.com
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