[New-bugs-announce] [issue43042] tutorial ambiguous about creation of local symbol table for recursive calls

Jesse Silverman report at bugs.python.org
Wed Jan 27 13:42:22 EST 2021


New submission from Jesse Silverman <jessevsilverman at gmail.com>:

In section 4.6 of the tutorial, we find:

"When a function calls another function, a new local symbol table is created for that call."

Now, perhaps because we were just looking at a function that people will often ask you to write both recursively and non-recursively and then ask which one you would use and why...I was thinking "Wait -- when a function calls itself recursively, obviously they need a new local symbol table or local variables won't work??"

I may be confused, in which case the doc is fine and I personally need to better understand the moral equivalent of activation record / stack frame in Python.

If I am not, given that recursion isn't much more computer science oriented or obscure than Fibonacci sequences, could it not be worth the investment of a few extra words as:

"When a function calls another function, or calls itself recursively, a new local symbol table is created for that call."

----------
assignee: docs at python
components: Documentation
messages: 385800
nosy: docs at python, jessevsilverman
priority: normal
severity: normal
status: open
title: tutorial ambiguous about creation of local symbol table for recursive calls
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43042>
_______________________________________


More information about the New-bugs-announce mailing list