diff options
author | Brandt Bucher <brandtbucher@gmail.com> | 2020-02-26 12:01:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 12:01:48 -0800 |
commit | d0ca9bd93bb9d8d4aa9bbe939ca7fd54ac870c8f (patch) | |
tree | c58f460744dcdd401d55dc1a79f7dd875d31bfa5 /Doc/library | |
parent | 6aa1f1ecf7142a4117eedb8c570f30da1598616c (diff) | |
download | cpython-git-d0ca9bd93bb9d8d4aa9bbe939ca7fd54ac870c8f.tar.gz |
bpo-36144: Document PEP 584 (GH-18659)
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/stdtypes.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 47d64f1e8d..435ba5b74f 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4392,6 +4392,22 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: >>> d.values() == d.values() False + .. describe:: d | other + + Create a new dictionary with the merged keys and values of *d* and + *other*, which must both be dictionaries. The values of *other* take + priority when *d* and *other* share keys. + + .. versionadded:: 3.9 + + .. describe:: d |= other + + Update the dictionary *d* with keys and values from *other*, which may be + either a :term:`mapping` or an :term:`iterable` of key/value pairs. The + values of *other* take priority when *d* and *other* share keys. + + .. versionadded:: 3.9 + Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', '>') raise :exc:`TypeError`. |