nonlocal fails ?
Chris Angelico
rosuav at gmail.com
Sat Nov 23 18:34:11 EST 2019
On Sun, Nov 24, 2019 at 10:19 AM Richard Damon <Richard at damon-family.org> wrote:
> Yes, as presented, it doesn't handle the concept of scope of variables,
> but that starts to get into more complexity than you might want for a
> simple model, and it is simple to extend to handle it, either every
> scope gets a different color post-it note, or when you write the name of
> the variable, you include the scope.
Or you can try to describe a scope as like a notebook where you say "x
is Blue K12" where the thing is identified by a matching note (think
raffle tickets). Not sure how useful it'd be, but the concept does at
least scale. Recursion means setting down one notebook and picking up
another (with most/all of the same names).
ChrisA
More information about the Python-list
mailing list