[Python-Dev] file system path protocol PEP

Ethan Furman ethan at stoneleaf.us
Thu May 12 11:42:36 EDT 2016
On 05/12/2016 01:31 AM, Sven R. Kunze wrote:

> I think the "Rationale" section ignores the fact the Path also supports
> the .path attribute now. Which indeed defines a common interface between
> path objects.

The version of Python that has Path.path has not been released yet.  And 
even so, .path is not a "common interface" as neither str nor bytes have 
it, and they also are used as path objects.

And even given all that, for smoother interoperability with the rest of 
the stdlib, or at least the os.* portion, those functions would still 
need to be upgraded to check for .path on the incoming arguments -- at 
which point we may as well make a protocol to properly support file 
system paths instead of relying on the rather generic attribute name of 
'path'.

--
~Ethan~


More information about the Python-Dev mailing list