Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #106603

Re: recursive methods require implementing a stack?

From Rob Gaddi <rgaddi@highlandtechnology.invalid>
Newsgroups comp.lang.python
Subject Re: recursive methods require implementing a stack?
Date 2016-04-06 20:28 +0000
Organization A noiseless patient Spider
Message-ID <ne3rhv$e1e$1@dont-email.me> (permalink)
References <ne3r48$bk8$1@dont-email.me>

Show all headers | View raw


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.

-- 
Rob Gaddi, Highland Technology -- www.highlandtechnology.com

Email address domain is currently out of order.  See above to fix.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

recursive methods require implementing a stack? "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-04-06 20:21 +0000
  Re: recursive methods require implementing a stack? Rob Gaddi <rgaddi@highlandtechnology.invalid> - 2016-04-06 20:28 +0000
    Re: recursive methods require implementing a stack? "Charles T. Smith" <cts.private.yahoo@gmail.com> - 2016-04-07 06:46 +0000
      Re: recursive methods require implementing a stack? Michael Selik <michael.selik@gmail.com> - 2016-04-07 07:25 +0000

csiph-web