[Python-Dev] pathlib - current status of discussions
Donald Stufft
donald at stufft.io
Mon Apr 11 18:38:56 EDT 2016
> On Apr 11, 2016, at 5:58 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
>
> name:
> ----
>
> We are down to two choices:
>
> - __fspath__, or
> - __fspathname__
>
> The final choice I suspect will be affected by the choice to allow (or not) bytes.
+1 on __fspath__, -0 on __fspathname__
>
>
>
> add a Path ABC:
> --------------
>
> undecided
I think it makes sense to add it, but maybe only in 3.6? Path accepting code could be updated to do something like `isinstance(obj, (bytes, str, PathMeta))` which seems like a net win to me.
>
>
> Sticking points:
> ---------------
>
> Do we allow bytes to be returned from os.fspath()? If yes, then do we allow bytes from __fspath__()?
I think yes and yes, it seems like making it needlessly harder to deal with a bytes path in the scenarios that you’re actually dealing with them is the kind of change that 3.0 made that ended up getting rolled back where it could.
-----------------
Donald Stufft
PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.python.org/pipermail/python-dev/attachments/20160411/4d916038/attachment.sig>
More information about the Python-Dev
mailing list