[Python-ideas] Working with pathlib.Path objects
Ethan Furman
ethan at stoneleaf.us
Tue Mar 29 15:22:00 EDT 2016
On 03/29/2016 11:51 AM, Brett Cannon wrote:
> I wrote a blog post at
> http://www.snarky.ca/why-pathlib-path-doesn-t-inherit-from-str because
> my response was getting a bit long. I have pasted it below in CommonMark.
Thanks for that.
For myself at least, I also find the complexity of pathlib completely
unnecessary: I see the structure of paths as loose at best -- at least
in regards to the kinds of things we do with paths:
- changing file names either in part or in whole,
- changing directory names or making new directories from portions of
the names of previous directories,
- looking for directory or file names that have some substring as part
of their names
- etc.
And yes, it is possible to incorrectly combine two path pieces (or a
path and a string) together and get something that is semantically
invalid -- but you can do that with any thing more complex than a random
jumble of characters:
- sentences
- names
- phrases
- paragraphs
- etc.
But oh well -- what's done is done and we're probably stuck with it now.
--
~Ethan~
More information about the Python-ideas
mailing list