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 abacabadabacaba
Recipients abacabadabacaba
Date 2010-04-17.19:26:17
SpamBayes Score 7.161536e-07
Marked as misclassified No
Message-id <1271532379.1.0.0904311359185.issue8435@psf.upfronthosting.co.za>
In-reply-to
Content
This code shows that frozensets aren't really immutable. The same frozenset is printed twice, with different content. Buggy functions are set_contains, set_remove and set_discard, all in Objects/setobject.c

class bad:
	def __eq__(self, other):
		global f2
		f2 = other
		print_f2()
		s1.add("querty")
		return self is other
	def __hash__(self):
		return hash(f1)
def print_f2():
	print(id(f2), repr(f2))
f1 = frozenset((1, 2, 3))
s1 = set(f1)
s1 in {bad()}
print_f2()
History
Date User Action Args
2010-04-17 19:26:19abacabadabacabasetrecipients: + abacabadabacaba
2010-04-17 19:26:19abacabadabacabasetmessageid: <1271532379.1.0.0904311359185.issue8435@psf.upfronthosting.co.za>
2010-04-17 19:26:17abacabadabacabalinkissue8435 messages
2010-04-17 19:26:17abacabadabacabacreate