recursive methods require implementing a stack?
Charles T. Smith
cts.private.yahoo at gmail.com
Thu Apr 7 02:46:28 EDT 2016
On Wed, 06 Apr 2016 20:28:47 +0000, Rob Gaddi wrote:
> Charles T. Smith wrote:
>
>> I just tried to write a recursive method in python - am I right that local
>> variables are only lexically local scoped, so sub-instances have the same
>> ones? Is there a way out of that? Do I have to push and pop my own simulated
>> stack frame entry?
>
> You have been badly misled. Python local variables are frame local, and
> recursion just works.
Well, I probably stumbled astray due to my own stupidity, can't blame anybody
of having misled me... ;)
So it's a bug in my program! Good news! Thank you.
More information about the Python-list
mailing list