Sorry for the double post, but I wanted to make sure you saw my original
misplaced post:

Jumping into functions that mutate variables in the calling scope sounds a
lot like "GoTo" <https://en.wikipedia.org/wiki/Considered_harmful> which is
notorious for leading to code that's very hard to reason about. Your
functions would implicitly require that you assign variables in the calling
scope before calling the function instead of explicitly requiring them in
the function's signature. That can be very confusing.

A lot of times, when I find that my function call signatures have become
unwieldy, it's a sign that I need to bundle a lot of related variables into
an object and either define methods on that object or pass that object to
functions instead of the large number of variables that it encapsulates.
You just use 'self' as a sort-of back-pack that carries around what you
need.

It's difficult to see what you're after from your Verb and Morpheme
example. They don't seem to call any functions that use variables from the
caller's scope. Can you flesh that out a bit more to show where the problem
arrises?
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to