Message74461
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. |
|
Date |
User |
Action |
Args |
2008-10-07 15:58:34 | Carl.Friedrich.Bolz | set | recipients:
+ Carl.Friedrich.Bolz |
2008-10-07 15:58:34 | Carl.Friedrich.Bolz | set | messageid: <1223395114.41.0.0284557162772.issue4069@psf.upfronthosting.co.za> |
2008-10-07 15:58:32 | Carl.Friedrich.Bolz | link | issue4069 messages |
2008-10-07 15:58:31 | Carl.Friedrich.Bolz | create | |
|