Recursively traverse linked list -- help!

Paul Rubin phr-n2002a at nightsong.com
Wed Feb 20 11:31:45 EST 2002


"Terry Reedy" <tjreedy at home.com> writes:
> def f(val):
>   global f
>   f = val and f1 or f2
>   return f(val)

This is not tail recursion.  The "global f" declaration shadows
the "f" that names the function.



More information about the Python-list mailing list