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/2004-April/044614.html below:

[Python-Dev] dict.merge()?

[Python-Dev] dict.merge()? [Python-Dev] dict.merge()?Tim Peters tim.one at comcast.net
Fri Apr 30 12:47:56 EDT 2004
[Jewett, Jim J]
> At the C level,
>
> 	PyDict_Update(old, new)
>
> is just a shortcut for
>
> 	override=1
> 	PyDict_Merge(old, new, override)

It is today, but that's a relatively new internal ability; IIRC, Guido added
it to help with the implementation of new-style classes.

> C extensions can use PyDict_Merge directly with override=0,
> which keeps the current value in case of duplicate keys.

Yes.

> Python code can only use update, which means that override
> is always true.

Yes.

> Is there a good reason this?

Dunno -- define "good" <0.5 wink>.


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