[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Paul Sokolovsky
Hello, On Wed, 9 Dec 2020 02:01:58 +1100 Chris Angelico wrote: > On Tue, Dec 8, 2020 at 11:05 PM Paul Sokolovsky > wrote: > > > It'd be best to > > > just write what you want directly, using the tools in importlib. > > > > Of course, the implementation of the above for CPython would be > >

[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Chris Angelico
On Tue, Dec 8, 2020 at 11:05 PM Paul Sokolovsky wrote: > > It'd be best to > > just write what you want directly, using the tools in importlib. > > Of course, the implementation of the above for CPython would be based on > importlib. And other implementations could implement that "directly", >

[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Paul Sokolovsky
Hello, On Tue, 8 Dec 2020 22:32:42 +1100 Chris Angelico wrote: > On Tue, Dec 8, 2020 at 9:54 PM Paul Sokolovsky > wrote: > > > > Hello, > > > > On Tue, 8 Dec 2020 07:29:15 -0300 > > "Joao S. O. Bueno" wrote: > > > > > And how would Python compute the "full basename of the file to be > > >

[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Chris Angelico
On Tue, Dec 8, 2020 at 9:54 PM Paul Sokolovsky wrote: > > Hello, > > On Tue, 8 Dec 2020 07:29:15 -0300 > "Joao S. O. Bueno" wrote: > > > And how would Python compute the "full basename of the file to be > > imported"? > > The way it does it usually. > That involves a number of searches for

[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Paul Sokolovsky
Hello, On Tue, 8 Dec 2020 07:29:15 -0300 "Joao S. O. Bueno" wrote: > And how would Python compute the "full basename of the file to be > imported"? The way it does it usually. > How could it guess among all directories on sys.path the one > containing the "file", and check if it is a file or

[Python-ideas] Re: Thinking about dead simple import hooks...

2020-12-08 Thread Joao S. O. Bueno
And how would Python compute the "full basename of the file to be imported"? How could it guess among all directories on sys.path the one containing the "file", and check if it is a file or a package without going through the existing mechanism? Maybe this proposal is good - but possibly, just