<div dir="ltr"><div>Here's a comparison table of os, os.path, shutil, pathlib, and path.py.</div><div><br></div><div>The full version is at</div><div><a href="https://github.com/westurner/pyfilemods">https://github.com/westurner/pyfilemods</a> (README.rst)</div><div>and at</div><div><a href="https://westurner.github.io/pyfilemods">https://westurner.github.io/pyfilemods</a>.</div><div><br></div><div>I ran a few set intersections and went ahead and</div><div>wrote a report to compare function/method signatures and sources.</div><div><br></div><div>(cc'ed ironically, for the last time, I promise,</div><div> from the other fork of this thread:</div><div><a href="https://mail.python.org/pipermail/python-ideas/2018-March/049375.html">https://mail.python.org/pipermail/python-ideas/2018-March/049375.html</a> )</div><div><br></div><div>... trio wraps pathlib methods with async; which also might as well be done in pathlib?</div><div>- Does it make sense to copy the docstrings at import time every time?</div><div><br></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">attr table</font></div><div><font face="monospace, monospace">==========</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div><font face="monospace, monospace">attr               os os.path shutil pathlib path.py</font></div><div><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div><font face="monospace, monospace">`__div__`_                                    X</font></div><div><font face="monospace, monospace">`__rdiv__`_                                   X</font></div><div><font face="monospace, monospace">`absolute`_                          X</font></div><div><font face="monospace, monospace">`abspath`_            X                       X</font></div><div><font face="monospace, monospace">`access`_          X                          X</font></div><div><font face="monospace, monospace">`altsep`_          X  X</font></div><div><font face="monospace, monospace">`anchor`_                            X</font></div><div><font face="monospace, monospace">`as_posix`_                          X</font></div><div><font face="monospace, monospace">`as_uri`_                            X</font></div><div><font face="monospace, monospace">`atime`_                                      X</font></div><div><font face="monospace, monospace">`basename`_           X                       X</font></div><div><font face="monospace, monospace">`bytes`_                                      X</font></div><div><font face="monospace, monospace">`capitalize`_                                 X</font></div><div><font face="monospace, monospace">`casefold`_                                   X</font></div><div><font face="monospace, monospace">`cd`_                                         X</font></div><div><font face="monospace, monospace">`center`_                                     X</font></div><div><font face="monospace, monospace">`chdir`_           X                          X</font></div><div><font face="monospace, monospace">`chmod`_           X                 X        X</font></div><div><font face="monospace, monospace">`chown`_           X          X               X</font></div><div><font face="monospace, monospace">`chroot`_          X                          X</font></div><div><font face="monospace, monospace">`chunks`_                                     X</font></div><div><font face="monospace, monospace">`commonpath`_         X</font></div><div><font face="monospace, monospace">`commonprefix`_       X</font></div><div><font face="monospace, monospace">`copy`_                       X               X</font></div><div><font face="monospace, monospace">`copy2`_                      X               X</font></div><div><font face="monospace, monospace">`copyfile`_                   X               X</font></div><div><font face="monospace, monospace">`copymode`_                   X               X</font></div><div><font face="monospace, monospace">`copystat`_                   X               X</font></div><div><font face="monospace, monospace">`copytree`_                   X               X</font></div><div><font face="monospace, monospace">`count`_                                      X</font></div><div><font face="monospace, monospace">`ctime`_                                      X</font></div><div><font face="monospace, monospace">`curdir`_          X  X</font></div><div><font face="monospace, monospace">`cwd`_                               X</font></div><div><font face="monospace, monospace">`defpath`_         X  X</font></div><div><font face="monospace, monospace">`devnull`_         X  X</font></div><div><font face="monospace, monospace">`dirname`_            X                       X</font></div><div><font face="monospace, monospace">`dirs`_                                       X</font></div><div><font face="monospace, monospace">`drive`_                             X        X</font></div><div><font face="monospace, monospace">`encode`_                                     X</font></div><div><font face="monospace, monospace">`endswith`_                                   X</font></div><div><font face="monospace, monospace">`exists`_             X              X        X</font></div><div><font face="monospace, monospace">`expand`_                                     X</font></div><div><font face="monospace, monospace">`expandtabs`_                                 X</font></div><div><font face="monospace, monospace">`expanduser`_         X              X        X</font></div><div><font face="monospace, monospace">`expandvars`_         X                       X</font></div><div><font face="monospace, monospace">`ext`_                                        X</font></div><div><font face="monospace, monospace">`extsep`_          X  X</font></div><div><font face="monospace, monospace">`files`_                                      X</font></div><div><font face="monospace, monospace">`find`_                                       X</font></div><div><font face="monospace, monospace">`fnmatch`_                    X               X</font></div><div><font face="monospace, monospace">`format`_                                     X</font></div><div><font face="monospace, monospace">`format_map`_                                 X</font></div><div><font face="monospace, monospace">`get_owner`_                                  X</font></div><div><font face="monospace, monospace">`getatime`_           X                       X</font></div><div><font face="monospace, monospace">`getctime`_           X                       X</font></div><div><font face="monospace, monospace">`getcwd`_          X                          X</font></div><div><font face="monospace, monospace">`getmtime`_           X                       X</font></div><div><font face="monospace, monospace">`getsize`_            X                       X</font></div><div><font face="monospace, monospace">`glob`_                              X        X</font></div><div><font face="monospace, monospace">`group`_                             X</font></div><div><font face="monospace, monospace">`home`_                              X</font></div><div><font face="monospace, monospace">`in_place`_                                   X</font></div><div><font face="monospace, monospace">`index`_                                      X</font></div><div><font face="monospace, monospace">`is_absolute`_                       X</font></div><div><font face="monospace, monospace">`is_block_device`_                   X</font></div><div><font face="monospace, monospace">`is_char_device`_                    X</font></div><div><font face="monospace, monospace">`is_dir`_                            X</font></div><div><font face="monospace, monospace">`is_fifo`_                           X</font></div><div><font face="monospace, monospace">`is_file`_                           X</font></div><div><font face="monospace, monospace">`is_reserved`_                       X</font></div><div><font face="monospace, monospace">`is_socket`_                         X</font></div><div><font face="monospace, monospace">`is_symlink`_                        X</font></div><div><font face="monospace, monospace">`isabs`_              X                       X</font></div><div><font face="monospace, monospace">`isalnum`_                                    X</font></div><div><font face="monospace, monospace">`isalpha`_                                    X</font></div><div><font face="monospace, monospace">`isdecimal`_                                  X</font></div><div><font face="monospace, monospace">`isdigit`_                                    X</font></div><div><font face="monospace, monospace">`isdir`_              X                       X</font></div><div><font face="monospace, monospace">`isfile`_             X                       X</font></div><div><font face="monospace, monospace">`isidentifier`_                               X</font></div><div><font face="monospace, monospace">`islink`_             X                       X</font></div><div><font face="monospace, monospace">`islower`_                                    X</font></div><div><font face="monospace, monospace">`ismount`_            X                       X</font></div><div><font face="monospace, monospace">`isnumeric`_                                  X</font></div><div><font face="monospace, monospace">`isprintable`_                                X</font></div><div><font face="monospace, monospace">`isspace`_                                    X</font></div><div><font face="monospace, monospace">`istitle`_                                    X</font></div><div><font face="monospace, monospace">`isupper`_                                    X</font></div><div><font face="monospace, monospace">`iterdir`_                           X</font></div><div><font face="monospace, monospace">`join`_               X                       X</font></div><div><font face="monospace, monospace">`joinpath`_                          X        X</font></div><div><font face="monospace, monospace">`lchmod`_                            X</font></div><div><font face="monospace, monospace">`lexists`_            X</font></div><div><font face="monospace, monospace">`lines`_                                      X</font></div><div><font face="monospace, monospace">`link`_            X                          X</font></div><div><font face="monospace, monospace">`listdir`_         X                          X</font></div><div><font face="monospace, monospace">`ljust`_                                      X</font></div><div><font face="monospace, monospace">`lower`_                                      X</font></div><div><font face="monospace, monospace">`lstat`_           X                 X        X</font></div><div><font face="monospace, monospace">`lstrip`_                                     X</font></div><div><font face="monospace, monospace">`makedirs`_        X                          X</font></div><div><font face="monospace, monospace">`makedirs_p`_                                 X</font></div><div><font face="monospace, monospace">`maketrans`_                                  X</font></div><div><font face="monospace, monospace">`match`_                             X</font></div><div><font face="monospace, monospace">`merge_tree`_                                 X</font></div><div><font face="monospace, monospace">`mkdir`_           X                 X        X</font></div><div><font face="monospace, monospace">`mkdir_p`_                                    X</font></div><div><font face="monospace, monospace">`module`_                                     X</font></div><div><font face="monospace, monospace">`move`_                       X               X</font></div><div><font face="monospace, monospace">`mtime`_                                      X</font></div><div><font face="monospace, monospace">`name`_            X                 X        X</font></div><div><font face="monospace, monospace">`namebase`_                                   X</font></div><div><font face="monospace, monospace">`normcase`_           X                       X</font></div><div><font face="monospace, monospace">`normpath`_           X                       X</font></div><div><font face="monospace, monospace">`open`_            X                 X        X</font></div><div><font face="monospace, monospace">`os`_                 X       X</font></div><div><font face="monospace, monospace">`owner`_                             X        X</font></div><div><font face="monospace, monospace">`pardir`_          X  X</font></div><div><font face="monospace, monospace">`parent`_                            X        X</font></div><div><font face="monospace, monospace">`parents`_                           X</font></div><div><font face="monospace, monospace">`partition`_                                  X</font></div><div><font face="monospace, monospace">`parts`_                             X</font></div><div><font face="monospace, monospace">`pathconf`_        X                          X</font></div><div><font face="monospace, monospace">`pathsep`_         X  X</font></div><div><font face="monospace, monospace">`read_bytes`_                        X</font></div><div><font face="monospace, monospace">`read_hash`_                                  X</font></div><div><font face="monospace, monospace">`read_hexhash`_                               X</font></div><div><font face="monospace, monospace">`read_md5`_                                   X</font></div><div><font face="monospace, monospace">`read_text`_                         X</font></div><div><font face="monospace, monospace">`readlink`_        X                          X</font></div><div><font face="monospace, monospace">`readlinkabs`_                                X</font></div><div><font face="monospace, monospace">`realpath`_           X                       X</font></div><div><font face="monospace, monospace">`relative_to`_                       X</font></div><div><font face="monospace, monospace">`relpath`_            X                       X</font></div><div><font face="monospace, monospace">`relpathto`_                                  X</font></div><div><font face="monospace, monospace">`remove`_          X                          X</font></div><div><font face="monospace, monospace">`remove_p`_                                   X</font></div><div><font face="monospace, monospace">`removedirs`_      X                          X</font></div><div><font face="monospace, monospace">`removedirs_p`_                               X</font></div><div><font face="monospace, monospace">`rename`_          X                 X        X</font></div><div><font face="monospace, monospace">`renames`_         X                          X</font></div><div><font face="monospace, monospace">`replace`_         X                 X        X</font></div><div><font face="monospace, monospace">`resolve`_                           X</font></div><div><font face="monospace, monospace">`rfind`_                                      X</font></div><div><font face="monospace, monospace">`rglob`_                             X</font></div><div><font face="monospace, monospace">`rindex`_                                     X</font></div><div><font face="monospace, monospace">`rjust`_                                      X</font></div><div><font face="monospace, monospace">`rmdir`_           X                 X        X</font></div><div><font face="monospace, monospace">`rmdir_p`_                                    X</font></div><div><font face="monospace, monospace">`rmtree`_                     X               X</font></div><div><font face="monospace, monospace">`rmtree_p`_                                   X</font></div><div><font face="monospace, monospace">`root`_                              X</font></div><div><font face="monospace, monospace">`rpartition`_                                 X</font></div><div><font face="monospace, monospace">`rsplit`_                                     X</font></div><div><font face="monospace, monospace">`rstrip`_                                     X</font></div><div><font face="monospace, monospace">`samefile`_           X              X        X</font></div><div><font face="monospace, monospace">`sameopenfile`_       X</font></div><div><font face="monospace, monospace">`samestat`_           X</font></div><div><font face="monospace, monospace">`sep`_             X  X</font></div><div><font face="monospace, monospace">`size`_                                       X</font></div><div><font face="monospace, monospace">`special`_                                    X</font></div><div><font face="monospace, monospace">`split`_              X                       X</font></div><div><font face="monospace, monospace">`splitall`_                                   X</font></div><div><font face="monospace, monospace">`splitdrive`_         X                       X</font></div><div><font face="monospace, monospace">`splitext`_           X                       X</font></div><div><font face="monospace, monospace">`splitlines`_                                 X</font></div><div><font face="monospace, monospace">`splitpath`_                                  X</font></div><div><font face="monospace, monospace">`splitunc`_                                   X</font></div><div><font face="monospace, monospace">`startswith`_                                 X</font></div><div><font face="monospace, monospace">`stat`_            X  X       X      X        X</font></div><div><font face="monospace, monospace">`statvfs`_         X                          X</font></div><div><font face="monospace, monospace">`stem`_                              X        X</font></div><div><font face="monospace, monospace">`strip`_                                      X</font></div><div><font face="monospace, monospace">`stripext`_                                   X</font></div><div><font face="monospace, monospace">`suffix`_                            X</font></div><div><font face="monospace, monospace">`suffixes`_                          X</font></div><div><font face="monospace, monospace">`swapcase`_                                   X</font></div><div><font face="monospace, monospace">`symlink`_         X                          X</font></div><div><font face="monospace, monospace">`symlink_to`_                        X</font></div><div><font face="monospace, monospace">`text`_                                       X</font></div><div><font face="monospace, monospace">`title`_                                      X</font></div><div><font face="monospace, monospace">`touch`_                             X        X</font></div><div><font face="monospace, monospace">`translate`_                                  X</font></div><div><font face="monospace, monospace">`uncshare`_                                   X</font></div><div><font face="monospace, monospace">`unlink`_          X                 X        X</font></div><div><font face="monospace, monospace">`unlink_p`_                                   X</font></div><div><font face="monospace, monospace">`upper`_                                      X</font></div><div><font face="monospace, monospace">`using_module`_                               X</font></div><div><font face="monospace, monospace">`utime`_           X                          X</font></div><div><font face="monospace, monospace">`walk`_            X                          X</font></div><div><font face="monospace, monospace">`walkdirs`_                                   X</font></div><div><font face="monospace, monospace">`walkfiles`_                                  X</font></div><div><font face="monospace, monospace">`with_name`_                         X</font></div><div><font face="monospace, monospace">`with_suffix`_                       X        X</font></div><div><font face="monospace, monospace">`write_bytes`_                       X        X</font></div><div><font face="monospace, monospace">`write_lines`_                                X</font></div><div><font face="monospace, monospace">`write_text`_                        X        X</font></div><div><font face="monospace, monospace">`zfill`_                                      X</font></div><div><font face="monospace, monospace">================== == ======= ====== ======= =======</font></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 23, 2018 at 6:22 PM, Mike Miller <span dir="ltr"><<a href="mailto:python-ideas@mgmiller.net" target="_blank">python-ideas@mgmiller.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On 2018-03-23 13:47, Jason Maldonis wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
    I’ve found it odd that there doesn’t even seem to be acknowledgment among<br>
    longtime python users that the current hodgepodge is pretty dysfunctional<br>
    for new users.<br>
</blockquote>
<br></span>
I'll acknowledge it too, just that after X years it becomes second nature as you know.<br>
<br>
Tinkered around at lunchtime with a module to bring them under one roof.  Named it "f2" because "fs" was taken on PyPI and thought the name should be very short since it could potentially be used in every script, like os and sys are.<br>
<br>
    <a href="https://github.com/mixmastamyk/f2" rel="noreferrer" target="_blank">https://github.com/mixmastamyk<wbr>/f2</a><br>
<br>
Just poking around these questions came up about what to include:<br>
<br>
    - Include file descriptors apis?<br>
    - chroot?<br>
    - l- functions to not follow links?<br>
    - Unix dev files?  obscure<br>
    - pathconf?<br>
    - supports_* api?<br>
    - Only scandirs or walk too?<br>
<br>
    - Should unpack os.path functions into the root?  Handy but many of them.<br>
        - path and Path in same module could confuse.<br>
<br>
    - Unpack file-related shutil functions?  Or leave as submodule?<br>
<br>
<br>
Perhaps this is enough to generate some comments.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Mike</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/mailma<wbr>n/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofco<wbr>nduct/</a><br>
</div></div></blockquote></div><br></div>