Hi everybody, I need to overload the operator in and let him return an object ... It seems it is not a behavior Python expect :
>>> class A: ... def __contains__(self,a): ... return 'yop' ... >>> a=A() >>> print 'toto' in a True >>> print a.__contains__('toto') yop I don't know if it's a bug or a feature but i really need this overloading and don't know how to do it ... Furthermore I can't use a trick of the kind : a |in| b ... because my overloaded operator must be called by : a in b ... Is someone could help me ? -- http://mail.python.org/mailman/listinfo/python-list