py: Implement __contains__ special method.