<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>On 17 Mar 2018, at 22:49, George Fischhof <<a href="mailto:george@fischhof.hu">george@fischhof.hu</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">2018. márc. 17. 21:34 ezt írta ("Barry" <<a href="mailto:barry@barrys-emacs.org">barry@barrys-emacs.org</a>>):<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div class="elided-text"><div></div><div><br></div><div><br>On 17 Mar 2018, at 10:42, George Fischhof <<a href="mailto:george@fischhof.hu" target="_blank">george@fischhof.hu</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi folks,<div><br></div><div>I added the list of functions to the proposal, here is the new version.</div><div><br></div><div>George</div><div><br></div><div><br></div><div><br></div><br>PEP: 9999<br>Title: Pathlib Module Should Contain All File Operations<br>Author: George Fischhof <george at <a href="http://fischhof.hu" target="_blank">fischhof.hu</a>><br>Status: Draft<br>Type: Standards Track<br>Content-Type: text/x-rst<br>Created: 15-Mar-2018<br>Python-Version: 3.8<br>Post-History: 12-Mar-2018, 17-Mar-2018<br><br><br>Abstract<br>========<br><br>This PEP proposes pathlib module to be a centralized place for all<br>file-system related operations.<br><br><br>Rationale<br>=========<br><br>Right now we have several modules that contain functions related<br>to file-system operations mainly the os, pathlib and shutil.<br>For beginners it is quite hard to remember where can he / she find<br>a function (copy resides in shutil, but the remove function can be<br>found in the os module.  (And sometimes developers with moderate<br>experience have to check the documentation as well.)<br><br>After the release of version 3.6 several methods became aware of<br>path-like object.  There are only a few ones which does not support<br>the path-like object.  After making these methods path-like object<br>aware, these functions could be added to pathlib.<br><br>With functions in pathlib the developers should not have to think<br>on which method (function) can be found in which module.<br><br>Makes the life easier.<br><br><br>Implementation<br>==============<br><br>For compatibility reasons the pathlib should contain wrappers to<br>the original functions.  The original functions should remain<br>at their original place.  (Or if pathlib contains the function, the<br>original modules should have a wrapper to it.)<br><br><br>List of mentioned functions<br>===========================<br><br>    * <a href="http://os.link" target="_blank">os.link</a> => path.hardlink_to<br>      (should be named similarly to path.softlink_to)<br><br>    * os.mkfifo<br><br>    * os.readlink<br><br>    * os.remove<br><br>    * os.removedirs<br>      (shutil.rmtree has the same functionalaty)<br></div></div></blockquote><div><br></div></div>I think you will find these to are a lot different.</div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">From high level, it is only question of implementation: the main goal is to remove a chain of directories</div></div></div></blockquote><div><br></div>This is a PEP you and proposing details matter and this is one of the details tha you need be clear on.<div><br><blockquote type="cite"><div><div dir="auto"><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><blockquote type="cite"><div><div dir="ltr"><br>    * os.truncate<br><br>    * shutil.copyfileobj<br></div></div></blockquote><div><br></div>This function does not take paths as arguments. I guess it does not belong here.</div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto"></div><div dir="auto"><br></div><div dir="auto">No path, it is true (right now), but it has sense to have this function among the others.</div></div></div></blockquote><div><br></div>What do you mena right now?<div><br><blockquote type="cite"><div><div dir="auto"><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="quoted-text"><br><blockquote type="cite"><div><div dir="ltr"><br>    * shutil.copyfile<br><br>    * shutil.copymode<br><br>    * shutil.copystat<br><br>    * shutil.copy<br><br>    * shutil.copy2<br><br>    * shutil.copytree with shutil.ignore_patterns<br><br>    * shutil.move<br><br>    * shutil.disk_usage<br><br>    * shutil.chown<br></div></div></blockquote><div><br></div></div>Is yout plan to also expose all the constants need to use chmod etc from pathlib?</div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Of course, because this PEP is about conveniece and easyness.</div></div></div></blockquote><div><br></div>Can you say so then and not leave it in doubt.</div><div><br><blockquote type="cite"><div><div dir="auto"><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br></div><div><div class="quoted-text"><blockquote type="cite"><div><div dir="ltr"><br>All functions from os module accept path-like objects,<br>and none of the shutil functions.<br></div></div></blockquote><div><br></div></div>Should shutils be improved to accept path-like first?</div><div></div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Maybe. The PEP should show the goal. This is just a task among others to achieve the goal. But it can be done simultanuosly.</div><div dir="auto"><br></div><div dir="auto">George</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br></div><div>Barry</div><div><br></div><div><div class="quoted-text"><blockquote type="cite"><div><div dir="ltr"><br><br>Copyright<br>=========<br><br>This document has been placed in the public domain.<br><br><br> <br>..<br>   Local Variables:<br>   mode: indented-text<br>   indent-tabs-mode: nil<br>   sentence-end-double-space: t<br>   fill-column: 70<br>   coding: utf-8<br>   End:<br><br><div><br></div><div><br></div><div><br></div></div>
</div></blockquote></div><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>Python-ideas mailing list</span><br><span><a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a></span><br><span><a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a></span><br><span>Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a></span><br></div></blockquote></div></div></blockquote></div><br></div></div></div>
</div></blockquote></div></div></body></html>