I've sent a patch to email@example.com which does the 'in' hook in the pseudo-right way: adding a slot to the sequence methods structure, and adding a flag to support it for backwards compatability.
Now that it's there, I've also changed instance method to use it, and to map it to __contains__. The code there also has special-case for strings, so if someone (maybe me) adds such a slot to strings, then the code will only have to do the C equivalent of
try: obj.__contains__(whatever) except AttributeError: for element in obj: if element == whatever: return 1 return 0
Is this desirable? It shouldn't be too hard...
-- Moshe Zadka firstname.lastname@example.org. INTERNET: Learn what you know. Share what you don't.