<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><br><div>On Mar 23, 2018, at 7:26 AM, Steve Dower <<a href="mailto:steve.dower@python.org">steve.dower@python.org</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><div class="WordSection1"><p class="MsoNormal">I had a colleague complaining to me the other day about having to search multiple packages for the right function to move a file (implying: with the same semantics as drag-drop). </p></div></div></blockquote><div><br></div><div>Thanks Steve — I know there isn’t any kind of consensus about exactly what should be part of a “most file operations” package/class, but I’ve found it odd that there doesn’t even seem to be acknowledgment among longtime python users that the current hodgepodge is pretty dysfunctional for new users.</div><div><br></div><div>One thing that’s been hammered home for me teaching newbies is that people get very far with computing these days without ever having touched a command line — certainly not a *nix one. Even the concept of a working directory is foreign to many.</div><div><br></div><div>So telling them that they can create and manipulate paths in nifty ways with the Path object, but then telling them to go to the os module to do simple things like rename or delete a file, and then looking at the docs for the os module, which starts with a bunch of references to other modules you need for not quite as simple things (shutil) or more complex things (tempfile). Then you look through the module and see a LOT of low level cryptic and semi-platform dependent functions — not newbie friendly.</div><div><br></div><div>Heck, I’ve been using Python for almost 20 years and I still have go look up whether it’s “delete” or “remove” or “unlink”. And there is so much in os that ipython or IDE completion doesn’t help much.</div><div><br></div><div>So as not to only write a critical rant — here is a proposal of sorts:</div><div><br></div><div>The python standard library should have one-stop shopping for the basic file system manipulations. “Basic” could be guided by “what users typically do with a GUI file manager”</div><div><br></div><div>This could be yet another module, but given that navigating  the file system ( I.e. path manipulation) is one of the things people typically do with a file manager, it makes sense to add it all to pathlib, maybe even all to the Path object. ( though maybe more advanced classes/functions could be added to pathlib as way to put it all in one place, while not expanding the Path namespace too much)</div><div><br></div><div>Of course, this will require a substantial amount of work to work out the details in a PEP. I don’t have the time to do that, but if the OP or someone else does, I’ll help.</div><div><br></div><div>-CHB</div><div><br></div><div><br></div><div><br></div><br><blockquote type="cite"><div><div class="WordSection1"><p class="MsoNormal"> </p><p class="MsoNormal">If there isn’t a pathtools library on PyPI yet, this would certainly be valuable for newer developers. My view on Path is to either have everything on it or nothing on it (without removing what’s already there, of course), and since everything is so popular we should at least put everything in the one place.</p><p class="MsoNormal"> </p><p class="MsoNormal">Top-posted from my Windows phone</p><p class="MsoNormal"> </p><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in"><p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:python-ideas@mgmiller.net">Mike Miller</a><br><b>Sent: </b>Monday, March 19, 2018 10:51<br><b>To: </b><a href="mailto:python-ideas@python.org">python-ideas@python.org</a><br><b>Subject: </b>Re: [Python-ideas] New PEP proposal -- Pathlib Module ShouldContain All File Operations -- version 2</p></div><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal">On 2018-03-18 10:55, Paul Moore wrote:</p><p class="MsoNormal">>> Should Path() have methods to access all file operations?</p><p class="MsoNormal">> </p><p class="MsoNormal">> No, (Counterexample, having a Path operation to set Windows ACLs for a path).</p><p class="MsoNormal"> </p><p class="MsoNormal">Agreed, not a big fan of everything filesystem-related in pathlib, simply </p><p class="MsoNormal">because it doesn't read well.  Having them scattered isn't a great experience </p><p class="MsoNormal">either.</p><p class="MsoNormal"> </p><p class="MsoNormal">Perhaps it would be better to have a filesystem package instead, maybe named </p><p class="MsoNormal">"fs" that included all this stuff in one easy to use location.  File stuff from </p><p class="MsoNormal">os, path stuff from os.path, pathlib, utils like stat, and shutil etc?</p><p class="MsoNormal">_______________________________________________</p><p class="MsoNormal">Python-ideas mailing list</p><p class="MsoNormal"><a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a></p><p class="MsoNormal"><a href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a></p><p class="MsoNormal">Code of Conduct: <a href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></p><p class="MsoNormal"> </p></div></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Python-ideas mailing list</span><br><span><a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a></span><br><span><a href="https://mail.python.org/mailman/listinfo/python-ideas">https://mail.python.org/mailman/listinfo/python-ideas</a></span><br><span>Code of Conduct: <a href="http://python.org/psf/codeofconduct/">http://python.org/psf/codeofconduct/</a></span><br></div></blockquote></body></html>