> - there is no os function that returns "str or bytes, I don't 
>   care which". (If you really need that, call __fspath__ directly.)

os.fspath() in the PEP works when given str or bytes directly, but those
don't have a __fspath__ method, so directly calling the dunder method is not
equivalent to calling os.fspath(). The whole point of having os.fspath() is
to pass str or paths (or bytes) and get an appropriate object for lew-level
functions.

_______________________________________________
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

Reply via email to