[Python-ideas] Making Path() a built in.
desmoulinmichel at gmail.com
Tue Jun 5 09:30:35 EDT 2018
There are very few programs that never use any path operation.
Opening a file is such a common one we have a built-in for it with
open(), but you usually need to do some manipulation to get the file
path in the first place.
We have __file__, but the most common usage is to get the parent dir,
with os or pathlib.
Websites open static files and configurations file.
GUI open files to be processed.
Data processing open data source files.
Terminal apps often pass files as a parameters.
All those paths you may resolve, turn absolute, check against and so on.
So much that pathlib.Path is one of the things I always put in a
PYTHONSTARTUP since you need it so often.
I think Path fits the bill for being a built-in, I feel it's used more
often than any/all or zip, and maybe enumerate.
Besides, it would help to make people use it, as I regularly meet dev
that keep import os.path because of habits, tutorials, books, docs, etc.
More information about the Python-ideas