nonlocal fails ?

Michael Torrie torriem at gmail.com
Thu Nov 14 15:22:06 EST 2019


On 11/14/19 10:57 AM, R.Wieser wrote:
> The trick seems to be to emulate a "by reference" call, by using a mutable 
> object as the argument and stuff the value inside of it (IIRC a tuple with a 
> single element).

I note that you didn't answer the question, what are you trying to
accomplish? In other words, what problem are you trying to solve.  It
looks to me like you're trying to write a program in a different
language here, not Python.  Although come to that I can't think of very
many reasons to do what you propose in any language.

If you mentioned what problem you are trying to solve, I'm sure folks
can suggest cleaner, more idiomatic ways of doing it in Python.


More information about the Python-list mailing list