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.

classification
Title: more __contains__ tests
Type: Stage:
Components: Tests Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, georg.brandl, jimjjewett, mcherm, rhettinger
Priority: low Keywords: patch

Created on 2005-02-18 00:42 by jimjjewett, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_richcmp.diff jimjjewett, 2005-02-25 00:20
seq_tests.diff2 jimjjewett, 2005-03-04 19:32 adding an in-order check to seq_tests
Messages (5)
msg47802 - (view) Author: Jim Jewett (jimjjewett) Date: 2005-02-18 00:42
Recently, there was a change to speed up 
__contains__.  

x in (1, 2, 3) would be compiled as 
x in frozenset(1, 2, 3).

This was backed out, because frozensets raise a 
typeerror when asked about unhashable objects.  
These objects *can't* be in the set, but there was 
concern about supporting objects in which a mutable 
and an immutable compare equal.

So long as that is a requirement, it should be tested.  

The new test for sequences ensures that they will use 
__eq__ (and not rely on __hash__) in the future.  

The change to the rich compare tests is just a 
comment, pointing out that dicts can rely on 
__hash__ as well as __eq__.
msg47803 - (view) Author: Michael Chermside (mcherm) (Python triager) Date: 2005-02-23 13:26
Logged In: YES 
user_id=99874

In the change to test_richcmp.diff, you should move the
period to the end of the sentence.

That being said, I'm +1 on applying this patch. I certainly
agree that we should add the test since we care about
preserving the behavior.
msg47804 - (view) Author: Jim Jewett (jimjjewett) Date: 2005-02-25 00:22
Logged In: YES 
user_id=764593

Period moved, per mcherm's comment.
msg47805 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2005-08-24 07:17
Logged In: YES 
user_id=80475

Check in for Py2.5 only.
msg47806 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-08-24 09:09
Logged In: YES 
user_id=1188172

Committed as test_richcmp.py r1.11 and seq_tests.py r1.5.
History
Date User Action Args
2022-04-11 14:56:09adminsetgithub: 41596
2005-02-18 00:42:23jimjjewettcreate