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.

class MyClass(object):
    ...

m = MyClass()

if 54 in m:
    ...

3 Answers
3

Leave a Reply

Your email address will not be published. Required fields are marked *