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

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

[Python-Dev] performance of {} versus dict() [Python-Dev] performance of {} versus dict()Brian Curtin brian at python.org
Wed Nov 14 22:43:46 CET 2012
On Wed, Nov 14, 2012 at 3:40 PM, Brandon W Maister <bwmaister at gmail.com> wrote:
>
>>
>> To (mis-)quote Antoine:
>> >--> d1 = {1:2}
>> >--> d2 = {'3':4}
>> >--> dict(d1, **d2)
>> > {1: 2, '3': 4}
>>
>> Apparently it is valid syntax.  Just make sure you keys for the **
>> operator are valid strings.  :)
>>
>
> or not:
>
>>>> dict(**{'not a valid identifier': True, 1: True})
> {1: True, 'not a valid identifier': True}

Just because the string says it's not valid doesn't mean it's not valid.

Anyway, can this thread go to python-ideas or python-list now?
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