def find_geom ( geom , geoms ) : for i , g in enumerate ( geoms ) : if g is geom : return i
finding an element in a 2d list in python
Returns the index of a geometry in a list of geometries avoiding expensive equality checks of in operator .
def find_geom(geom, geoms):
    """
    Returns the index of a geometry in a list of geometries avoiding
    expensive equality checks of `in` operator.
    """
    for i, g in enumerate(geoms):
        if g is geom:
            return i