[issue38210] Intersection of dict view with iterator returns empty set

Dong-hee Na report at bugs.python.org
Thu Jul 15 00:01:41 EDT 2021


Dong-hee Na <donghee.na at python.org> added the comment:

>Interestingly, this doesn't seem to have a negative effect on correctness as the silently omitted unhashable

I think so too.

The error actually raises when adding the object into the set.
https://github.com/python/cpython/blob/818628c2da99ba0376313971816d472c65c9a9fc/Objects/dictobject.c#L4384

Since the target object to be added is dynamically generated, I think that the issue does not need to be fixed.
Otherwise, we have to check that all objects are addable to `set` object before executing this operation but it looks harmful to performance.

----------

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


More information about the Python-bugs-list mailing list