pathlib is a provisional stdlib module. However, as the current threads (here, here, here and here) on python-ideas show, it is not as easy to work with as originally intended. Once you have a Path object, it's quite easy to use what Path offers which is a lot.
One big problem, though, is the interaction of Path objects with existing stdlib functions. Most of the later are string-consuming functions whereas the former are no strings at all. As far as I can see, this is one reason why pathlib lacks broader adoption and many agree. This situation leads to the following possible resolutions:
- make Path objects compatible with strings (basically make them inherit from strings)
- make existing stdlib functions accept Path objects (basically make them accept both and convert if needed)
- do both but that seems superfluous
Solution 2 would also affect third-party libraries as noted here.
In order to decide appropriately, it becomes necessary to answer the following question:
In order to decide appropriately, it becomes necessary to answer the following question: