Re: How make your module substitute a python stdlib module.

2022-12-28 Thread Thomas Passin
On 12/28/2022 5:39 AM, Antoon Pardon wrote: Op 27/12/2022 om 16:49 schreef Thomas Passin: On 12/27/2022 8:25 AM, Antoon Pardon wrote: Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon Pardon wrote: At the moment I am happy with a solution that once the prog

Re: How make your module substitute a python stdlib module.

2022-12-28 Thread Antoon Pardon
Op 27/12/2022 om 16:49 schreef Thomas Passin: On 12/27/2022 8:25 AM, Antoon Pardon wrote: Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon PardonĀ  wrote: At the moment I am happy with a solution that once the programmer has imported from QYZlib.threaders th

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Thomas Passin
On 12/27/2022 8:25 AM, Antoon Pardon wrote: Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon PardonĀ  wrote: At the moment I am happy with a solution that once the programmer has imported from QYZlib.threaders that module will used as the threading module.

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Dieter Maurer
Antoon Pardon wrote at 2022-12-27 14:25 +0100: > ... >> But a simple "sys.modules['threading'] = QYZlib.threaders" will work. >> Of course, how *well* this works depends also on how well that module >> manages to masquerade as the threading module, but I'm sure you've >> figured that part out :) >

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Mark Bourne
Antoon Pardon wrote: Op 27/12/2022 om 11:37 schreef Chris Angelico: On Tue, 27 Dec 2022 at 21:29, Antoon Pardon wrote: OK, I am writing an alternative for the threading module. What I would like to know is how I can get some library modules call my alternative instead of the threading module

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Antoon Pardon
Op 27/12/2022 om 13:46 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:28, Antoon Pardon wrote: At the moment I am happy with a solution that once the programmer has imported from QYZlib.threaders that module will used as the threading module. Oh! If that's all you need, then yes, a simp

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Chris Angelico
On Tue, 27 Dec 2022 at 23:28, Antoon Pardon wrote: > > > > Op 27/12/2022 om 13:09 schreef Chris Angelico: > > On Tue, 27 Dec 2022 at 23:06, Antoon Pardon wrote: > >>> How do you intend to distinguish one from the other? How should the > >>> logging module know which threading module to use? > >>

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Antoon Pardon
Op 27/12/2022 om 13:09 schreef Chris Angelico: On Tue, 27 Dec 2022 at 23:06, Antoon Pardon wrote: How do you intend to distinguish one from the other? How should the logging module know which threading module to use? That is my question! How can I get the logging module to use my module.I w

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Chris Angelico
On Tue, 27 Dec 2022 at 23:06, Antoon Pardon wrote: > > How do you intend to distinguish one from the other? How should the > > logging module know which threading module to use? > > That is my question! How can I get the logging module to use my module.I was > hoping the logging module would allo

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Antoon Pardon
Op 27/12/2022 om 12:28 schreef Chris Angelico: On Tue, 27 Dec 2022 at 22:13, Antoon Pardon wrote: Op 27/12/2022 om 11:37 schreef Chris Angelico: On Tue, 27 Dec 2022 at 21:29, Antoon Pardon wrote: OK, I am writing an alternative for the threading module. What I would like to know is how

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Chris Angelico
On Tue, 27 Dec 2022 at 22:13, Antoon Pardon wrote: > > > > Op 27/12/2022 om 11:37 schreef Chris Angelico: > > On Tue, 27 Dec 2022 at 21:29, Antoon Pardon wrote: > >> OK, I am writing an alternative for the threading module. What I would > >> like to know is how I can get some library modules call

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Antoon Pardon
Op 27/12/2022 om 11:37 schreef Chris Angelico: On Tue, 27 Dec 2022 at 21:29, Antoon Pardon wrote: OK, I am writing an alternative for the threading module. What I would like to know is how I can get some library modules call my alternative instead of the threading module. For instance there

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Chris Angelico
On Tue, 27 Dec 2022 at 21:29, Antoon Pardon wrote: > > OK, I am writing an alternative for the threading module. What I would > like to know is how I can get some library modules call my alternative > instead of the threading module. > > For instance there is the logging module, it can log the thr

How make your module substitute a python stdlib module.

2022-12-27 Thread Antoon Pardon
OK, I am writing an alternative for the threading module. What I would like to know is how I can get some library modules call my alternative instead of the threading module. For instance there is the logging module, it can log the thread name. So I would like to know how I can get the logging