[Python-ideas] New PEP proposal -- Pathlib Module Should Contain All File Operations

George Fischhof george at fischhof.hu
Mon Mar 12 16:57:32 EDT 2018


Good day all,

as it seemed to be a good idea, I wrote a PEP proposal for pathlib to
contain file operations.

Here is the draft. What do you think about this?

BR,
George

---------------------------


PEP: 9999
Title: Pathlib Module Should Contain All File Operations
Author: George Fischhof <george at fischhof.hu>
Status: Draft
Type: Standards Track
Content-Type: text/x-rst
Created: 15-Mar-2018
Python-Version: 3.8
Post-History:


Abstract
========

This PEP proposes pathlib module to be a centralized place for all
file-system related operations.


Rationale
=========

Right now we have several modules that contain functions related
to file-system operations mainly the os, pathlib and shutil.
For beginners it is quite hard to remember where can he / she find
a function (copy resides in shutil, but the remove function can be
found in the os module.  (And sometimes developers with moderate
experience have to check the documentation as well.)

After the release of version 3.6 several methods became aware of
path-like object.  There are only a few ones which does not support
the path-like object.  After making these methods path-like object
aware, these functions could be added to pathlib.

With functions in pathlib the developers should not have to think
on which method (function) can be found in which module.

Makes the life easier.


Implementation
==============

For compatibility reasons the pathlib should contain wrappers to
the original functions.  The original functions should remain
at their original place.  (Or if pathlib contains the function, the
original modules should have a wrapper to it.)



Copyright
=========

This document has been placed in the public domain.


..
   Local Variables:
   mode: indented-text
   indent-tabs-mode: nil
   sentence-end-double-space: t
   fill-column: 70
   coding: utf-8
   End:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180312/888fccb8/attachment-0001.html>


More information about the Python-ideas mailing list