[issue4069] set.remove raises confusing KeyError

Amaury Forgeot d'Arc report at bugs.python.org
Tue Oct 7 18:40:25 CEST 2008


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

The KeyError initially contains the correct frozenset, but its content
is swapped with the original set object (yes, like C++ std::set::swap(),
this mutates the frozenset!).

Attached a patch with unit test. The exception now shows the original key:
    KeyError: {3, 4}

----------
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file11733/set_remove.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4069>
_______________________________________


More information about the Python-bugs-list mailing list