[Python-ideas] tweaking the file system path protocol

Steven D'Aprano steve at pearwood.info
Sun May 28 12:32:16 EDT 2017


On Sun, May 28, 2017 at 05:35:38PM +0300, Koos Zevenhoven wrote:

> Don't get me wrong, I like consistency very much. But regarding the
> __fspath__ case, there are not that many people *writing*
> fspath-enabled classes. Instead, there are many many many more people
> *using* such classes (and dealing with their compatibility issues in
> different ways).

What sort of compatibility issues are you referring to? os.fspath is new 
in 3.6, and 3.7 isn't out yet, so I'm having trouble understanding what 
compatibility issues you mean.


> For those people, the current behavior brings consistency

That's a very unintuitive statement. How is it consistent for fspath to 
call the __fspath__ dunder method for some objects but ignore it for 
others?


> ---after all, it was of course designed by thinking about
> it from all angles and not just based on my or anyone else's own use
> cases only.

Can explain the reasoning to us? I don't think it is explained in the 
PEP.


-- 
Steve


More information about the Python-ideas mailing list