On Feb 14, 11:09 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 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 thestackspace with the local > variables inside eachcall. If this is not good, is there a better way > to implement? Orpythonitself will understand that the calls happen > in the last line, so local variables need not be pushed into thestack? > > 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
I found a simpler solution: get rid of recursive calls; using while loops. - Suresh -- http://mail.python.org/mailman/listinfo/python-list