If I am creating my own class in Python, what function should I define so as to allow the use of the in operator, e.g.
in
class MyClass(object): ... m = MyClass() if 54 in m: ...
MyClass.__contains__(self, item)
1.4m articles
1.4m replys
5 comments
57.0k users