#!/usr/local/bin/python2 from collections import Container class C(Container): def __init__(self, l): self._l = l def __contains__(self, item): return item in self._l c = C([0]) print c[0]