[issue24229] pathlib.Path should have a copy() method

2016-02-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker ___

[issue24229] pathlib.Path should have a copy() method

2015-05-19 Thread Josh Holland
Josh Holland added the comment: Serhiy makes a series of good points, which I hadn't really considered before filing this report. It was mostly laziness on my part while dashing off a quick script - I knew I wouldn't have to deal with the edge cases so subconsciously dismissed them,

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Josh Holland
New submission from Josh Holland: Path objects already have rename() and replace() methods; it would be useful for them also to have a copy() method to simplify that operation. I'll look into putting a patch together this evening. -- components: Library (Lib) messages: 243494 nosy:

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Path objects are immutable, so the copy method is not needed. -- nosy: +pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24229 ___

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Paul Moore
Paul Moore added the comment: I presume the copy method is intended as a file copy, not for copying the object. But calling the method copy() is likely to be confusing, precisely as happened here :-) -- nosy: +paul.moore ___ Python tracker

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: If copy() has a mandatory argument, it can't really be mixed up with an object-cloning method. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24229 ___

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: File renaming is simple and usually atomic operation. File copying is complex operation. What memory buffer should be used for copying? What to do with growing files or reading with errors? Should file space be preallocated before copyiong to decrease