[issue40853] "set() in set()" should raise TypeError: unhashable type: 'set'

Raymond Hettinger report at bugs.python.org
Wed Jun 3 11:57:23 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

> is it possible to make dict give consistent result?

That is unlikely (there isn't much need, it would introduce a cross-type dependency, it would be awkward dicts which use keys in many more ways than sets do).

For the time being, a user should explicitly convert to a frozenset:

    frozenset(s) in d

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list