Re: Passing information between modules

2022-11-20 Thread Chris Angelico
On Mon, 21 Nov 2022 at 16:26, dn wrote: > Am put-off by the 'smell' of subverting/adapting names like print() = > surprise/confusion factor - but I think I understand where you're going. To be fair, redefining the "print" function IS one of the reasons that it's no longer a statement. Though I

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.29, Stefan Ram wrote: dn writes: A 'standard' solution is to collect all such configuration-data at the start of the application, into an object (or other data-structure) - I usually call it "env" (an instantiation of "Environment"). Yeah, I had some functions of my

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
On 11/21/2022 12:01 AM, dn wrote: On 21/11/2022 12.07, Dan Kolis wrote: If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... Ouch! Does the first sentence imply who is the more important person in the interaction? Does the second further

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 12.07, Dan Kolis wrote: If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... Ouch! Does the first sentence imply who is the more important person in the interaction? Does the second further the idea that anyone/everyone who

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
On 11/20/2022 4:07 PM, Roel Schroeven wrote: Thomas Passin schreef op 20/11/2022 om 20:33: https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413 https://devblogs.microsoft.com/oldnewthing/20101125-00/?p=12203 Now that I think about it, The Old New Thing is also where I got the

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
Its advice, I don't think the style issue is particularly important. If you understand its meaning, it achieves my purpose. If you don't I you're perhaps not a programmer... I like the abruptness of technical writing as a style, actually. If that is how machine learning ( aka 'A.I.' ) tends to

Re: Passing information between modules

2022-11-20 Thread Chris Angelico
On Mon, 21 Nov 2022 at 09:37, Dan Kolis wrote: > > Using sys.stdout / is simply nonsense. The more I think about it, the more I > realise how bad it is. > > Going on about it endlessly seems pointless. > > If the even mini threading thing is turned on, now what ? some other module > eats the

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
Using sys.stdout / is simply nonsense. The more I think about it, the more I realise how bad it is. Going on about it endlessly seems pointless. If the even mini threading thing is turned on, now what ? some other module eats the message intended for a different module ? A state machine with

Re: Passing information between modules

2022-11-20 Thread Roel Schroeven
Thomas Passin schreef op 20/11/2022 om 20:33: https://devblogs.microsoft.com/oldnewthing/20050607-00/?p=35413 https://devblogs.microsoft.com/oldnewthing/20101125-00/?p=12203 Now that I think about it, The Old New Thing is also where I got the global vs local thing: "Don’t use global state to

Re: Passing information between modules

2022-11-20 Thread Thomas Passin
On 11/20/2022 1:50 PM, Roel Schroeven wrote: Stefan Ram schreef op 20/11/2022 om 11:39:    The idea is about parameterizing the behavior of a module.    For example, the module "M" may contain functions that contain    "input.read()" to get input and "output.write()" to write    output. Then

Re: Passing information between modules

2022-11-20 Thread dn
On 21/11/2022 01.03, Stefan Ram wrote: dn writes: In some respects we have the (OP) problem because Python does not have "interfaces" as a formal component of the language. What one can do today is, class my_interface( metaclass=abc.ABCMeta ): """This interface ..."""

Re: Passing information between modules

2022-11-20 Thread Roel Schroeven
Stefan Ram schreef op 20/11/2022 om 11:39: The idea is about parameterizing the behavior of a module. For example, the module "M" may contain functions that contain "input.read()" to get input and "output.write()" to write output. Then one would write code like (the following is

Re: An email from a user

2022-11-20 Thread Thomas Passin
On 11/20/2022 7:32 AM, Hoe Tee wrote: Hi, I recently installed Python 3.11.0 on my laptop. However, there was no folder named 'Python' in my Program folder after the software was installed. I'm writing this letter since I'm a python learner and the loss of the Python folder in the Program folder

Re: An email from a user

2022-11-20 Thread Hoe Tee
Hi, I recently installed Python 3.11.0 on my laptop. However, there was no folder named 'Python' in my Program folder after the software was installed. I'm writing this letter since I'm a python learner and the loss of the Python folder in the Program folder seems to cause the Pycharm on my

Re: Passing information between modules

2022-11-20 Thread Dan Kolis
It's certainly not an "incredibly bad idea", it is a mildly bad idea however. Why be stuck with maybe's and just text strings ? Functions as "first class operators" and object oriented languages are a natural pair with a bit of heavy thinking. The problem is... there is nobody giving you a 3

Re: Passing information between modules

2022-11-20 Thread Avi Gross
There is no guarantee that argv is consulted earlier in the program than other modules will use it for communication. Consider a case where a program does look at argv but later wants to call another program using some or all of the components of argv and now there are added components there.