Hi,
 I have a program which literately finds the object that overlapping a
point. The horizontal and vertical search are called recursively from
inside each other.
 Is this way of implementation fill the stack space with the local
variables inside each call. If this is not good, is there a better way
to implement? Or python itself will understand that the calls happen
in the last line, so local variables need not be pushed into the
stack?

def find_point(pt):
    return _hor_search(pt, random_obj)

def _hor_search(pt, obj):
    ...
    object = ...
    ...
    if object meets some condition:
        return object
    else:
        return _ver_search(pt, object)

def _ver_search(pt, obj):
    ...
    object = ...
    ...
    if object meets some condition:
        return object
    else:
        return _hor_search(pt, object)


-
Suresh

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to