A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2012-October/122193.html below:

Tweak the threaded example in concurrent.futures

[Python-Dev] [Python-checkins] cpython (3.3): Tweak the threaded example in concurrent.futuresChris Jerdonek chris.jerdonek at gmail.com
Tue Oct 16 16:35:25 CEST 2012
On Tue, Oct 16, 2012 at 5:51 AM, nick.coghlan
<python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/a3f27289ec68
> changeset:   79746:a3f27289ec68
> branch:      3.3
> +           except Exception as exc:
> +               print('%r generated an exception: %s' % (url, exc))
>             else:
> -               print('%r page is %d bytes' % (url, len(future.result())))
> +               print('%r page is %d bytes' % (url, len(data)))

I'm not suggesting this particular example be changed, but going
forward should we prefer the newer str.format() approach to
formatting?

http://docs.python.org/dev/library/stdtypes.html#printf-style-string-formatting

I've also seen references in the docs to the "old %-style formatting,"
but maybe old is meant more in the sense of having been around longer
than discouraged.

--Chris
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