Recursive inner function... How?

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jan 1 08:57:55 EST 2001


Bjorn Pettersen <pbjorn at uswest.net> writes:

>     def outer():
>         def inner(inner):
>                inner(inner)
>         inner(inner)
> 
>     outer()
> 
> Please tell me I'm doing something wrong?

I'd say you try to use local functions in the wrong place. Just make
inner a global function; perhaps naming it _inner so it won't be
imported by accident.

Regards,
Martin



More information about the Python-list mailing list