A long time ago (2004 may be) there was a
path module written by Jason Orendorff
(older version) that many people included in their projects. Various alternative implementations existed such as
this one. For personal projects, I had my own version of this module, obtained by adding more and more methods to the Path class.
The main benefit of these classes is the programmer's comfort. It is satisfying to build paths by using the division operator instead of joining strings, it is comfortable to have features available by calling an object's method.
If you look at python's pathlib, you'll notice that the devs have been very careful about which methods to include and which methods not to include in the classes. It makes the Path class less attractive that it could be, at the same time, this care is understandable. The Path class will probably slowly add important features.
I try to use pathlib as often as I can because of this past experience with other Path classes which saved me a lot of pain in my programs. I think yes, pathlib can completely replace os.path, and using
os.path
has a taste of
backward compatibility!