[New-bugs-announce] [issue36431] Use dict unpacking for merging two dicts

Serhiy Storchaka report at bugs.python.org
Tue Mar 26 02:33:08 EDT 2019


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

The following PR replaces the sequence of statement

    d = d1.copy()
    d.update(d2)

(where d1 and d2 are dicts) with a form proposed in PEP 448:

    d = {**d1, **d2}

or equivalent.

Besides functools, where using the new syntax makes the code clearer, there are not much occurrences of such idiom: only in yet 5 files, 1-2 times per file.

----------
components: Library (Lib)
messages: 338857
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use dict unpacking for merging two dicts
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36431>
_______________________________________


More information about the New-bugs-announce mailing list