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/2012-November/122703.html below:

[Python-Dev] performance of {} versus dict()

[Python-Dev] performance of {} versus dict() [Python-Dev] performance of {} versus dict()Mark Adam dreamingforward at gmail.com
Wed Nov 14 19:54:32 CET 2012
On Wed, Nov 14, 2012 at 12:12 PM, Xavier Morel <catch-all at masklinn.net> wrote:
> On 2012-11-14, at 18:10 , Mark Adam wrote:
>>
>> Try the canonical {'x':1}.  Only dict allows the special
>> initialization above.  Other collections require an iterable.
>
> Other collections don't have a choice, because it would often be
> ambiguous. Dicts do not have that issue.

mkay....

>>  I'm guessing
>> **kwargs initialization was only used because it is so simple to
>> implement, but that's not necessarily a heuristic for good language design.
>
> In this case it very much is, it permits easily merging two dicts in a
> single expression or cloning-with-replacement. It also mirrors the
> signature of dict.update which I think is a Good Thing.

Merging of two dicts is done with dict.update.   How do you do it on
initialization?  This doesn't make sense.

mark
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