Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-02-02 Thread George Fischhof
2017-01-12 20:11 GMT+01:00 Todd :

> On Thu, Jan 12, 2017 at 11:17 AM, Chris Barker - NOAA Federal <
> chris.bar...@noaa.gov> wrote:
>
>> I agree that this has been a bit of a wart for a long time.
>>
>> While the old “let’s treat strings as paths” modules are split up like
>> you said, pathlib can do what they do and more: https://docs.python.org/
>> 3/library/pathlib.html
>>
>>
>> Exactly -- this is The Solution. It combines paths themselves with things
>> you are likely to do with paths.
>>
>> It may well lack some nice features. If so, suggestions for that would be
>> the way to go.
>>
>
> Can such suggestions go here or should someone start a new thread?
>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>


Hi Guys,

I just would like to ask You whehet there is a step forward in this topic?

BR,
George
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread Chris Barker - NOAA Federal
> On Jan 12, 2017, at 2:26 PM, Terry Reedy  wrote:
>
>
> Start a new thread for 'Add x to pathlib'.
>
And do take some time to see if a given suggestion has already been
discussed first.

-CHB
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/


Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread Terry Reedy

On 1/12/2017 2:11 PM, Todd wrote:

On Thu, Jan 12, 2017 at 11:17 AM, Chris Barker - NOAA Federal
mailto:chris.bar...@noaa.gov>> wrote:

I agree that this has been a bit of a wart for a long time.


While the old “let’s treat strings as paths” modules are split up
like you said, pathlib can do what they do and
more: https://docs.python.org/3/library/pathlib.html



Exactly -- this is The Solution. It combines paths themselves with
things you are likely to do with paths.

It may well lack some nice features. If so, suggestions for that
would be the way to go.


Can such suggestions go here or should someone start a new thread?


Start a new thread for 'Add x to pathlib'.


--
Terry Jan Reedy


___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread Todd
On Thu, Jan 12, 2017 at 11:17 AM, Chris Barker - NOAA Federal <
chris.bar...@noaa.gov> wrote:

> I agree that this has been a bit of a wart for a long time.
>
> While the old “let’s treat strings as paths” modules are split up like you
> said, pathlib can do what they do and more: https://docs.python.org/
> 3/library/pathlib.html
>
>
> Exactly -- this is The Solution. It combines paths themselves with things
> you are likely to do with paths.
>
> It may well lack some nice features. If so, suggestions for that would be
> the way to go.
>

Can such suggestions go here or should someone start a new thread?
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread Chris Barker - NOAA Federal
I agree that this has been a bit of a wart for a long time.

While the old “let’s treat strings as paths” modules are split up like you
said, pathlib can do what they do and more:
https://docs.python.org/3/library/pathlib.html


Exactly -- this is The Solution. It combines paths themselves with things
you are likely to do with paths.

It may well lack some nice features. If so, suggestions for that would be
the way to go.

The usefulness of pathlib has been hampered by the fact that path objects
couldn't be used in many stdlib functions. However, that has been remedied
in 3.6:


   - A new file system path protocol
    has been
   implemented to support path-like objects
   . All
   standard library functions operating on paths have been updated to work
   with the new protocol.

So we have a nice way forward.

-CHB




It’s also prettier and easier to use, especially when using autocompletion
(just type “path.is” and see what you can test the path for)

Best, Philipp

George Fischhof  schrieb am Do., 12. Jan. 2017 um
10:06 Uhr:

> Hi There,
>
> OS related file operations (copy, move, delete, rename...) should be
> placed into one module...
> As it quite confusing that they are in two moduls (os and shutil).
>
> I have read that one is higher level than other, but actually to use them
> I have to think which function can be found in which module.
>
> It is confuse for beginners, and makes the usage more complex instead of
> make it more simple (as Zen of Python says ;-) )
>
> An alias could good, not to cause incompatibility.
>
> Best regards,
> George
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/

___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread Philipp A.
Hi George,

While the old “let’s treat strings as paths” modules are split up like you
said, pathlib can do what they do and more:
https://docs.python.org/3/library/pathlib.html

It’s also prettier and easier to use, especially when using autocompletion
(just type “path.is” and see what you can test the path for)

Best, Philipp

George Fischhof  schrieb am Do., 12. Jan. 2017 um
10:06 Uhr:

> Hi There,
>
> OS related file operations (copy, move, delete, rename...) should be
> placed into one module...
> As it quite confusing that they are in two moduls (os and shutil).
>
> I have read that one is higher level than other, but actually to use them
> I have to think which function can be found in which module.
>
> It is confuse for beginners, and makes the usage more complex instead of
> make it more simple (as Zen of Python says ;-) )
>
> An alias could good, not to cause incompatibility.
>
> Best regards,
> George
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

[Python-ideas] OS related file operations (copy, move, delete, rename...) should be placed into one module

2017-01-12 Thread George Fischhof
Hi There,

OS related file operations (copy, move, delete, rename...) should be placed
into one module...
As it quite confusing that they are in two moduls (os and shutil).

I have read that one is higher level than other, but actually to use them I
have to think which function can be found in which module.

It is confuse for beginners, and makes the usage more complex instead of
make it more simple (as Zen of Python says ;-) )

An alias could good, not to cause incompatibility.

Best regards,
George
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/