[Python-Dev] When should pathlib stop being provisional? (original) (raw)
Antoine Pitrou antoine at python.org
Wed Apr 6 05:50:45 EDT 2016
- Previous message (by thread): [Python-Dev] When should pathlib stop being provisional?
- Next message (by thread): [Python-Dev] When should pathlib stop being provisional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ethan Furman <ethan stoneleaf.us> writes:
> > Not sure about os.path.*. The purpose of os.path module is manipulating > string paths. From the perspective of pathlib it can look lower level.
The point is that a function that receives a "path" object (whether str or Path) shouldn't have to care: it should be able to call os.path.split on the thing it received and get back a usable answer.
pathlib should already replicate the useful parts of os.path. That was the design goal after all.
So this is like saying you want a Python file or socket object to be accepted by os.read(). In the rare case where you want that, you call the .fileno() method explicitly. The equivalent for Path objects is to lookup the .path attribute explicitly.
Regards
Antoine.
- Previous message (by thread): [Python-Dev] When should pathlib stop being provisional?
- Next message (by thread): [Python-Dev] When should pathlib stop being provisional?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]