(Sep-30-2019, 03:06 PM)wpo Wrote: Ichabod: I see your point. In my case I need functionality that I can call upon in several parts of my main script, while at the same time I do not want to expose the internal technical details to the main script. In my latest example, the "global variables" are only visible in the module that contains the functions, not to the main script.Don't you see the contradiction? if you encapsulate your code and pass argument to functions and get result all the internals are irrelevant to the caller. It's like a black-box - you pass some arguments as input and get the result you know is correct (because you ere able to test it easily). Internals are irrelevant to the caller and not exposed. Note that modifications does not "disapper" as you claim/think. Your function will return whatever you want "to preserve" and then you assign it to a variable in the caller module.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs