Message105983
For operations that test membership in a set, Python coerces sets and subclasses of set into a temporary frozenset before testing membership.
For example, this works:
>>> set() in set([frozenset()])
True
Although the set() is not hashable itself, Python creates a temporary frozenset() out of the set(). It should do the same for user-types derived from collections.Set, so they can inter-operate in the same way.
In setobject.c, the following methods behave in the described manner: set_contains, set_remove, and set_discard. |
|
Date |
User |
Action |
Args |
2010-05-18 15:21:12 | stutzbach | set | recipients:
+ stutzbach |
2010-05-18 15:21:12 | stutzbach | set | messageid: <1274196072.83.0.116605329158.issue8752@psf.upfronthosting.co.za> |
2010-05-18 15:21:11 | stutzbach | link | issue8752 messages |
2010-05-18 15:21:10 | stutzbach | create | |
|