On 13 May 2016 at 06:53, Brett Cannon <br...@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 | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com