from file import x a = x if i in a: dosomething
file.py:
class x: def __init__(self): self.q = [] def __contains__(self,item):