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

2018-03-25 Thread eryk sun
On Sat, Mar 17, 2018 at 10:42 AM, George Fischhof wrote: > > All functions from os module accept path-like objects, > and none of the shutil functions. shutil indirectly supports __fspath__ paths via os and os.path. One exception is shutil.disk_usage() on Windows, which only

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

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

2018-03-18 Thread Paul Moore
On 18 March 2018 at 14:44, Barry Scott wrote: > It seems that the main quest to answer first is this. > > Should Path() have methods to access all file operations? No, (Counterexample, having a Path operation to set Windows ACLs for a path). > Maybe it was a mistake to

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

2018-03-18 Thread Barry Scott
It seems that the main quest to answer first is this. Should Path() have methods to access all file operations? Maybe it was a mistake to add the ones that are already there. Especially in light of the fspath protocol that now exists. If yes proceed to details the methods and their semantics.

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

2018-03-18 Thread Paul Moore
On 17 March 2018 at 22:49, George Fischhof wrote: >>> >>> * os.truncate >>> >>> * shutil.copyfileobj >>> >>> >>> This function does not take paths as arguments. I guess it does not belong >>> here. > > No path, it is true (right now), but it has sense to have this

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

2018-03-18 Thread Barry
> On 17 Mar 2018, at 22:49, George Fischhof wrote: > > > > 2018. márc. 17. 21:34 ezt írta ("Barry" ): > > >> On 17 Mar 2018, at 10:42, George Fischhof wrote: >> >> Hi folks, >> >> I added the list of functions to the

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

2018-03-17 Thread George Fischhof
2018. márc. 17. 21:34 ezt írta ("Barry" ): On 17 Mar 2018, at 10:42, George Fischhof wrote: Hi folks, I added the list of functions to the proposal, here is the new version. George PEP: Title: Pathlib Module Should Contain All File

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

2018-03-17 Thread Barry
> On 17 Mar 2018, at 10:42, George Fischhof wrote: > > Hi folks, > > I added the list of functions to the proposal, here is the new version. > > George > > > > > PEP: > Title: Pathlib Module Should Contain All File Operations > Author: George Fischhof > Status:

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

2018-03-17 Thread George Fischhof
Hi folks, I added the list of functions to the proposal, here is the new version. George PEP: Title: Pathlib Module Should Contain All File Operations Author: George Fischhof Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 15-Mar-2018 Python-Version: 3.8