Skip to content

Commit dfa24b8

Browse files
merwokhugovk
andauthored
edits
Co-authored-by: Hugo van Kemenade <[email protected]>
1 parent b45c8e5 commit dfa24b8

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -587,24 +587,27 @@ Improved error messages
587587
^^^^^^
588588
SyntaxError: cannot use subscript as import target
589589
590-
* Improved error message when trying to add an instance of an unhashable type
591-
to a :class:`dict` or :class:`set`:
592-
593-
(Contributed by Victor Stinner in :gh:`426449d`.)
590+
* Improved error message when trying to add an instance of an unhashable type to
591+
a :class:`dict` or :class:`set`. (Contributed by CF Bolz-Tereick and Victor Stinner
592+
in :gh:`132828`.)
594593

595594
.. code-block:: pycon
596595
597596
>>> s = set()
598597
>>> s.add({'pages': 12, 'grade': 'A'})
599598
Traceback (most recent call last):
600-
File "<stdin>", line 1, in <module>
601-
TypeError: Cannot use 'dict' as a set element (unhashable type).
599+
File "<python-input-1>", line 1, in <module>
600+
s.add({'pages': 12, 'grade': 'A'})
601+
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
602+
TypeError: cannot use 'dict' as a set element (unhashable type: 'dict')
602603
>>> d = {}
603604
>>> l = [1, 2, 3]
604605
>>> d[l] = 12
605606
Traceback (most recent call last):
606-
File "<stdin>", line 1, in <module>
607-
TypeError: Cannot use 'list' as a dict key (unhashable type).
607+
File "<python-input-4>", line 1, in <module>
608+
d[l] = 12
609+
~^^^
610+
TypeError: cannot use 'list' as a dict key (unhashable type: 'list')
608611
609612
610613
.. _whatsnew314-pep741:

0 commit comments

Comments
 (0)