(self, key)
return any(item.name == key for item in self.list)
Dictionary style __contains__ method.
Dictionary style __contains__ method.
Dictionary style __contains__ method .
def __contains__(self, key):
        """Dictionary style __contains__ method."""
        if self.list is None:
            raise TypeError("not indexable")
        return any(item.name == key for item in self.list)
def __contains__ ( self , key ) : if self . list is None : raise TypeError ( "not indexable" ) return any ( item . name == key for item in self . list )