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

2018-03-19 Thread Gregory P. Smith
On Thu, Mar 15, 2018 at 3:26 AM Nick Coghlan wrote: > On 14 March 2018 at 15:20, Chris Billington > wrote: >> >> I wonder if there's any reason something like this shouldn't be built >> into Python's default import system. >> > > There are two main challenges with enforcing such a check, one aff

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

2018-03-19 Thread Chris Barker
On Sun, Mar 18, 2018 at 10:53 PM, Greg Ewing wrote: > > The functions in os are thin wrappers around system calls, > exactly -- and this is a very old legacy from way back. Modern Python users should not have to concern themselves with whether something they want to do is essentially a system ca

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

2018-03-19 Thread Eric Fahlgren
On Mon, Mar 19, 2018 at 9:59 AM, Terry Reedy wrote: > I am convinced that *some* people, especially but not limited to newbies, > find the current situation confusing and less than optimal. I am also > pretty convinced that the idea of dumping a copy of everything into pathlib > is the wrong sol

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

2018-03-19 Thread Brett Cannon
On Sun, 18 Mar 2018 at 20:37 Nathaniel Smith wrote: > On Sun, Mar 18, 2018 at 4:58 AM, George Fischhof > wrote: > > Of course several details could be put into it, but I think it would > better > > to let the developers decide the details, because they know the > environment > > and the possibil

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

2018-03-19 Thread Mike Miller
On 2018-03-18 10:55, Paul Moore wrote: Should Path() have methods to access all file operations? No, (Counterexample, having a Path operation to set Windows ACLs for a path). Agreed, not a big fan of everything filesystem-related in pathlib, simply because it doesn't read well. Having them

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

2018-03-19 Thread Terry Reedy
On 3/19/2018 11:31 AM, Rhodri James wrote: On 18/03/18 11:58, George Fischhof wrote: it seems for me that the welcoming of this proposal is rather positive than not. I think you may have observer bias :-) Or, as often happens, George is making too much of a biased sample of opinions -- tho

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

2018-03-19 Thread Rhodri James
On 18/03/18 11:58, George Fischhof wrote: it seems for me that the welcoming of this proposal is rather positive than not. I think you may have observer bias :-) As far as I am concerned you have yet to make a convincing case that there is a problem, never mind that your solution is appropria

Re: [Python-ideas] Adding quantile to the statistics module

2018-03-19 Thread Steven D'Aprano
On Fri, Mar 16, 2018 at 01:36:31PM +0900, Stephen J. Turnbull wrote: > Steven D'Aprano writes: > > > Indeed. I've been considering quantiles and quartiles for a long time, > > and I've found at least ten different definitions for quantiles and > > sixteen for quartiles. > I'd like to see you

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

2018-03-19 Thread Wes Turner
Here's a comparison table of os, os.path, shutil, pathlib, and path.py. The full version is at https://github.com/westurner/pyfilemods (README.rst) and at https://westurner.github.io/pyfilemods. I ran a few set intersections and went ahead and wrote a report to compare function/method signatures

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

2018-03-19 Thread Petr Viktorin
On 03/19/18 09:17, Stephen J. Turnbull wrote: Nathaniel Smith writes: > Similarly, it's hard to explain why we have Path.mkdir but not > Path.makedirs So what? Let's fix that. As you propose: > (maybe it should be Path.mkdir(include_parents=True) > is fine, although that default seems a

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

2018-03-19 Thread Stephen J. Turnbull
Jason Maldonis writes: > So we have two "high-level" libraries (pathlib and shutil) pathlib is currently "low-level" as I understand the word. The only complex things it does are resolving and globbing, which are reasonable things to do with a Path's target object. Everything else is either a

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

2018-03-19 Thread Stephen J. Turnbull
Nathaniel Smith writes: > On Sat, Mar 17, 2018 at 10:15 AM, Stephen J. Turnbull > wrote: > > (5) perform operations on several objects denoted by Paths at once > > (copy and its multiple operand variants), > > Sure it does: Path.rename and Path.replace. I was very careful about the sem