<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">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>    * os.link => 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><br>    * os.truncate<br><br>    * shutil.copyfileobj<br><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><br>All functions from os module accept path-like objects,<br>and none of the shutil functions.<br><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>