On Wed, 2 Feb 2000, Guido van Rossum wrote:
I like the idea of overloading 'in' (and 'not in') with __contains__. There are several issues with this patch though (apart from the fact that he left out the disclaimer from http://www.python.org/1.5/bugrelease.html :-).
Sorry: I'd d/l it and mail it later...
Micro-nit: I want a space between 'if' and '('. It just looks better.
Sorry: old habits die hard. Change as you will.
But the real issue is what Moshe himself already brings up: contains should have a slot in the type struct, so extension types can also define this.
Moshe, do you feel like doing this right?
Yes, but not in the near future. Wouldn't adding a new slot break old
extension types? I'm a bit ignorant on the subject
--
Moshe Zadka