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

[Python-Dev] performance of {} versus dict(), de fmd(**kw): return kw trumps all ; -)

[Python-Dev] performance of {} versus dict(), de fmd(**kw): return kw trumps all ; -) [Python-Dev] performance of {} versus dict(), de fmd(**kw): return kw trumps all ; -)Stefan Behnel stefan_ml at behnel.de
Thu Nov 15 15:58:46 CET 2012
Greg Ewing, 15.11.2012 11:48:
> martin at v.loewis.de wrote:
>> It's faster than calling dict() because the dict code will
>> create a second dictionary, and discard the keywords dictionary.
> 
> Perhaps in the case where dict() is called with keyword
> args only, it could just return the passed-in keyword
> dictionary instead of creating another one?

This should work as long as this still creates a copy of d at some point:

    d = {...}
    dict(**d)

Stefan


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