Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #106615
| From | "Charles T. Smith" <cts.private.yahoo@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: recursive methods require implementing a stack? |
| Date | 2016-04-07 06:46 +0000 |
| Organization | A noiseless patient Spider |
| Message-ID | <ne4vo4$htk$1@dont-email.me> (permalink) |
| References | <ne3r48$bk8$1@dont-email.me> <ne3rhv$e1e$1@dont-email.me> |
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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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