diff options
author | Kyle Stanley <aeros167@gmail.com> | 2019-09-11 10:01:41 (GMT) |
---|---|---|
committer | Brett Cannon <54418+brettcannon@users.noreply.github.com> | 2019-09-11 10:01:41 (GMT) |
commit | 6472ece5a0fe82809d3aa0ffb281796fcd252d76 (patch) | |
tree | 79f2468c06c3efa8e6e7bbd50548ecf9ddc7c296 /Doc | |
parent | 4576b5431bd597df7581fe3c852b315e47e4b230 (diff) | |
download | cpython-6472ece5a0fe82809d3aa0ffb281796fcd252d76.zip cpython-6472ece5a0fe82809d3aa0ffb281796fcd252d76.tar.gz cpython-6472ece5a0fe82809d3aa0ffb281796fcd252d76.tar.bz2 |
bpo-37585: Add clarification regarding comparing dict.values() (GH-14954)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/stdtypes.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 0a565c3..c78f4ba 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -4357,6 +4357,14 @@ pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}`` or ``{4098: Return a new view of the dictionary's values. See the :ref:`documentation of view objects <dict-views>`. + An equality comparison between one ``dict.values()`` view and another + will always return ``False``. This also applies when comparing + ``dict.values()`` to itself:: + + >>> d = {'a': 1} + >>> d.values() == d.values() + False + Dictionaries compare equal if and only if they have the same ``(key, value)`` pairs. Order comparisons ('<', '<=', '>=', '>') raise :exc:`TypeError`. |