This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Carl.Friedrich.Bolz
Recipients Carl.Friedrich.Bolz
Date 2008-10-07.15:58:31
SpamBayes Score 3.3357002e-09
Marked as misclassified No
Message-id <1223395114.41.0.0284557162772.issue4069@psf.upfronthosting.co.za>
In-reply-to
Content
When trying to remove a set from a set, the KeyError that is raised is
confusing:

Python 2.6 (r26:66714, Oct  7 2008, 13:23:57)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> s = set([frozenset([1, 2]), frozenset([2, 3])])
>>> s.remove(set([3, 4]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: frozenset([])


I understand that s.remove(set(...)) turns the set into a frozenset, but
I was expecting this converted frozenset to be attached to the KeyError,
not an empty set.
History
Date User Action Args
2008-10-07 15:58:34Carl.Friedrich.Bolzsetrecipients: + Carl.Friedrich.Bolz
2008-10-07 15:58:34Carl.Friedrich.Bolzsetmessageid: <1223395114.41.0.0284557162772.issue4069@psf.upfronthosting.co.za>
2008-10-07 15:58:32Carl.Friedrich.Bolzlinkissue4069 messages
2008-10-07 15:58:31Carl.Friedrich.Bolzcreate