[Python-Dev] file system path protocol PEP

Guido van Rossum guido at python.org
Thu May 12 15:02:55 EDT 2016


On Thu, May 12, 2016 at 11:51 AM, Brett Cannon <brett at python.org> wrote:

>
> Anyway, with your strong preference of how to tweak os.fspath() what
> specifically would you like to see discussed at this point?
>

Preferably nothing. :-) There's been too much discussion already.


> Assuming the os.fspath() -> bytes discussion is dealt with, the only open
> issues listed in the PEP are the naming and placement of the ABC and how to
> do type hints for all of this (thanks to the dichotomy of path objects
> using the protocol and path-like objects which is the union of path object,
> str, and bytes and the joy of trying to name all of this well).
>

Name and placement: I think it belongs in os, and os.PathLike sounds like a
fine name. (I'm surprised that os.DirEntry doesn't exist.)

Typing: do you want it to be a generic class? If not, the types can be left
out of the stdlib and only put in the stub (though you can show them in the
PEP of course).

If you want it to be generic we have more work to do. I'm out of time now
but we can discuss that after 3pm today.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160512/a09e56f7/attachment.html>


More information about the Python-Dev mailing list