[New-bugs-announce] [issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

yesheng report at bugs.python.org
Wed Jun 3 06:26:55 EDT 2020


New submission from yesheng <sheng.1.ye at 139.com>:

>>> set() in set()
False  # should raise TypeError

>>> dict() in set()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'

>>> set() in dict()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'set'

>>> dict() in dict()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'

>>> frozenset({1,2}) in {frozenset({1,2}), 3}
True

>>> {1,2} in {frozenset({1,2}), 3}
True  # should raise TypeError

----------
messages: 370652
nosy: yesheng
priority: normal
severity: normal
status: open
title: "set() in set()" should raise TypeError: unhashable type: 'set'
type: behavior
versions: Python 3.8

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


More information about the New-bugs-announce mailing list