[3.9] bpo-26205: Specify the number of nested scopes (GH-21324) by miss-islington · Pull Request #21341 · python/cpython
Although scopes are determined statically, they are used dynamically. At any time during execution, there are at least three nested scopes whose namespaces are directly accessible: time during execution, At any time during execution, there are 3 or 4 nested scopes whose namespaces are directly accessible:
* the innermost scope, which is searched first, contains the local names * the scopes of any enclosing functions, which are searched starting with the