[Python-Dev] When should pathlib stop being provisional?

Serhiy Storchaka storchaka at gmail.com
Wed Apr 6 01:50:41 EDT 2016


On 06.04.16 05:44, Nick Coghlan wrote:
> The next challenge would then be to make a list of APIs to be updated
> for 3.6 to implicitly accept "rich path" objects via the agreed
> convention, with pathlib.PurePath used as a test class:
>
> * open()
> * codecs.open() (et al)
> * io.*
> * os.path.*
> * other os functions
> * shutil.*
> * tempfile.*
> * shelve.*
> * csv.*

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.

Supporting pathlib.Path will complicate and slow down os.path functions 
(they are already more complex and slow than were in Python 2). Since 
os.path functions often called several times in a loop, their 
performance is important. On other hand, some Path methods are more 
efficient than os.path functions, and Path specialized code at higher 
level can be more preferable.




More information about the Python-Dev mailing list