GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — GH-73991: Add `pathlib.Path.move()` by barneygale · Pull Request #122073 · python/cpython Conversation
|
|
Should be ready to review again :-) This isn't quite the last PR in this series. I'll log another to add |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry for flip-flopping. I've moved the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I've reviewed the other PR. Do you want me to review this one now or should I wait? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry for the slow reply - I think it would be best to wait for the other PR to land before reviewing this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hey @picnixz, this is ready to review again FYI. Thanks in advance :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to also have assertions before calling move(). That way you really know how the state of the files change before/after the test (and that way, we are sure that we are in a correct test environment). I did not mark all tests that need this but any test that does self.assertTrue(target.exists()) after moving should do self.assertFalse(target.exists()) before moving (and if the target is to be overwritten, then it should check that it's content changed).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| Added return value, return the new :class:`!Path` instance. | ||
|
|
||
|
|
||
| .. method:: Path.move(target) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Just me thinking loud, but do you think we should have a boolean to not overwrite an existing target (in which case, a FileExistsError would be raised)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We could add a clobber=True argument, but I think that would be a separate PR.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I would have thought of strict (strict=False by default, strict=True would raise) or replace=True. But we can address this question later. Otherwise, it's just a three liner where users would do if not os.exists(target) if they want to avoid replacing files.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"Clobber" has some currency already, e.g. in mv --no-clobber. But yeah, let's discuss later.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I don't understand why we'd make assertions before calling |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I shouldn't make review at 3 AM... Yes, why didn't I think about it. So yes, it's fine (I'm marking my comments as resolved). Sorry Barney for the time loss :( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Oh now, don't be silly! I really appreciate all your help with this PR and others, I apologise if I came off too strongly in my previous comment. I consider these sorts of discussions a great use of my time :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
No your comment was definitely legitimate! I also appreciate your review and feedback on my |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
All good for me! I'll leave the discussion on clubber opened so that you can create a separate issue from the comment if you want.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Amazing, thanks so much! I'll get back to your |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.