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/2015-February/138105.html below:

[Python-Dev] (no subject)

[Python-Dev] (no subject) [Python-Dev] (no subject)Greg Ewing greg.ewing at canterbury.ac.nz
Tue Feb 10 06:47:19 CET 2015
Donald Stufft wrote:
> 
> why is:
> 
> print(*[1], *[2], 3) better than print(*[1] + [2] + [3])?

It could potentially be a little more efficient by
eliminating the construction of an intermediate list.

> defining + or | or some other symbol for something similar 
> to [1] + [2] but for dictionaries. This would mean that you could simply do:
> 
> func(**dict1 | dict(y=1) | dict2)

Same again, multiple ** avoids construction of an
itermediate dict.

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