Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Danilo J. S. Bellini
On 20 March 2018 at 07:23, Chris Billington wrote: > It seems like running from within a package directory is bad news mostly > *because* of the double import problem, [...] > I think the main issue regarding loading a module from within a package directory is about the paths, non-absolute non-r

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Chris Billington
On Wed, Mar 21, 2018 at 10:58 AM, Chris Billington < chrisjbilling...@gmail.com> wrote: > I don't think that's true: > > > > On Wed, Mar 21, 2018 at 10:51 AM, Greg Ewing > wrote: > >> Chris Billington wrote: >> >>> I wonder how mercurial gets around the fact that its own imports might >>> be shad

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Chris Billington
I don't think that's true: On Wed, Mar 21, 2018 at 10:51 AM, Greg Ewing wrote: > Chris Billington wrote: > >> I wonder how mercurial gets around the fact that its own imports might be >> shadowed by whatever's in the current working directory. >> > > The cwd is only added to sys.path in the in

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Greg Ewing
Chris Billington wrote: I wonder how mercurial gets around the fact that its own imports might be shadowed by whatever's in the current working directory. The cwd is only added to sys.path in the interactive interpreter, not when you run "python something.py". So it's not usually a problem for

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-20 Thread Chris Barker
On Tue, Mar 20, 2018 at 4:23 PM Brett Cannon wrote: > > > "justify the individual methods" and yet no one has done that yet, so > any discussion other than trying to meet that need is not helping to move > anything forward. > My intent was, and still is, to encourage just that. And the rest of my

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-20 Thread Brett Cannon
On Mon, 19 Mar 2018 at 18:08 Chris Barker wrote: > [SNIP] > PS: does shutil really still not work with Path objects? aarrgg! > Did you verify this or are you just guessing? If this is true then file a bug and optionally submit a patch. Saying "aarrgg" doesn't fix the situation nor motivate peopl

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Chris Billington
On Tue, Mar 20, 2018 at 8:06 PM, Steven D'Aprano wrote: > On Wed, Mar 14, 2018 at 12:09:55PM -0700, Guido van Rossum wrote: > > > Yeah, one should never add a module to sys.path that has a __init__.py > file. > > Should import raise a warning in that case? > > I wouldn't want an outright error. I

Re: [Python-ideas] Disallow importing the same module under multiple names

2018-03-20 Thread Steven D'Aprano
On Wed, Mar 14, 2018 at 12:09:55PM -0700, Guido van Rossum wrote: > Yeah, one should never add a module to sys.path that has a __init__.py file. Should import raise a warning in that case? I wouldn't want an outright error. I've cd'ed into a package directory in the shell, then run a python mod

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-20 Thread Wes Turner
On Tue, Mar 20, 2018 at 4:25 AM, Nathaniel Smith wrote: > On Tue, Mar 20, 2018 at 1:03 AM, Wes Turner wrote: > > I added trio to the comparison table > > (Things are mostly just async-wrapped, > > though pathlib_not_trio does show a few missing methods?). > > trio.Path is an automatically genera

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-20 Thread Nathaniel Smith
On Tue, Mar 20, 2018 at 1:03 AM, Wes Turner wrote: > I added trio to the comparison table > (Things are mostly just async-wrapped, > though pathlib_not_trio does show a few missing methods?). trio.Path is an automatically generated, exact mirror of pathlib.Path, so I don't think it's very useful

Re: [Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

2018-03-20 Thread Wes Turner
I added trio to the comparison table (Things are mostly just async-wrapped, though pathlib_not_trio does show a few missing methods?). https://github.com/westurner/pyfilemods/issues/2 https://github.com/westurner/pyfilemods/blob/master/README.rst#attr-table == == === == ==