[Python-Dev] file system path protocol PEP (original) (raw)
Ethan Furman ethan at stoneleaf.us
Wed May 11 16:51:31 EDT 2016
- Previous message (by thread): [Python-Dev] file system path protocol PEP
- Next message (by thread): [Python-Dev] file system path protocol PEP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 05/11/2016 01:44 PM, Serhiy Storchaka wrote:
os.path '''''''
The various path-manipulation functions of
os.path
[#os-path] will be updated to accept path objects. For polymorphic functions that accept both bytes and strings, they will be updated to simply use code very much similar topath._fspath_() if hasattr(path, '_fspath_') else path
. This will allow for their pre-existing type-checking code to continue to function. I afraid that this will hit a performance. Some os.path functions are used in tight loops, they are hard optimized, and adding support of path protocol can have visible negative effect.
Do you have an example of os.path functions being used in a tight loop?
--
Ethan
- Previous message (by thread): [Python-Dev] file system path protocol PEP
- Next message (by thread): [Python-Dev] file system path protocol PEP
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]