On 13 May 2016 at 06:53, Brett Cannon <brett at python.org> wrote: > Second draft that takes Guido's comments into consideration. The biggest > change is os.fspath() now returns whatever path.__fspath__() returns instead > of restricting it to only str. > > Minor changes: > - Renamed the C function to PyOS_FSPath() > - Added an Implementation section with a TODO list > - Bunch of things added to the Rejected Ideas section +1 for this version from me, as it means we have: - os.fsencode(obj) as the coerce-to-bytes API - os.fspath(obj) as the str/bytes hybrid API - os.fsdecode(obj) as the coerce-to-str API - os.fspath(pathlib.PurePath(obj)) as the error-on-bytes API That more strongly nudges people towards "use pathlib if you want to ensure cross-platform friendly path handling", which is an outcome I'm fine with. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4