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 stutzbach
Recipients stutzbach
Date 2010-05-18.15:21:10
SpamBayes Score 6.0501785e-05
Marked as misclassified No
Message-id <1274196072.83.0.116605329158.issue8752@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-05-18 15:21:12stutzbachsetrecipients: + stutzbach
2010-05-18 15:21:12stutzbachsetmessageid: <1274196072.83.0.116605329158.issue8752@psf.upfronthosting.co.za>
2010-05-18 15:21:11stutzbachlinkissue8752 messages
2010-05-18 15:21:10stutzbachcreate