Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > >>Python iterates over "things" (objects), of which integer numbers are >>just one possible choice. The range built-in command produces ranges of >>integers which are useful for tasks such as this.
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Mike C. Fletcher <[EMAIL PROTECTED]> wrote: > >> Python iterates over "things" (objects), of which integer numbers are just one possible choice. The range built-in command produces ranges of integers which are useful for tasks such as this. >> [...clip (something that begs of recursion)...] > I don't think the list comprehension helps, in this case--although > it hints at the temptation of an eval-able expression which is briefer. > More on that, later. I noticed my last one had duplicates. I have wasted an embarrassingly large amount of time fixing it: def do_something(*args): print args def do_deeply(first, depth, lim, inc, doit=True, *args): if depth < lim: do_deeply(first+inc, depth+inc, lim, inc, False, *args) if first <= depth: do_deeply(first+inc, depth, lim, inc, True, *args + (first,)) elif doit: do_something(*args) do_deeply(first=1, depth=3, lim=4, inc=1) -- http://mail.python.org/mailman/listinfo/python-list