added isgap() to Python API