• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## dicts.add
2
3<pre>
4dicts.add(<a href="#dicts.add-dictionaries">dictionaries</a>, <a href="#dicts.add-kwargs">kwargs</a>)
5</pre>
6
7Returns a new `dict` that has all the entries of the given dictionaries.
8
9If the same key is present in more than one of the input dictionaries, the
10last of them in the argument list overrides any earlier ones.
11
12This function is designed to take zero or one arguments as well as multiple
13dictionaries, so that it follows arithmetic identities and callers can avoid
14special cases for their inputs: the sum of zero dictionaries is the empty
15dictionary, and the sum of a single dictionary is a copy of itself.
16
17
18### Parameters
19
20<table class="params-table">
21  <colgroup>
22    <col class="col-param" />
23    <col class="col-description" />
24  </colgroup>
25  <tbody>
26    <tr id="dicts.add-dictionaries">
27      <td><code>dictionaries</code></td>
28      <td>
29        optional.
30        <p>
31          Zero or more dictionaries to be added.
32        </p>
33      </td>
34    </tr>
35    <tr id="dicts.add-kwargs">
36      <td><code>kwargs</code></td>
37      <td>
38        optional.
39        <p>
40          Additional dictionary passed as keyword args.
41        </p>
42      </td>
43    </tr>
44  </tbody>
45</table>
46
47
48