[Python-ideas] tweaking the file system path protocol

Koos Zevenhoven k7hoven at gmail.com
Tue May 23 17:31:06 EDT 2017


On Wed, May 24, 2017 at 12:18 AM, Serhiy Storchaka <storchaka at gmail.com> wrote:
> It seems to me that the purpose of this proposition is not performance, but
> the possibility to use __fspath__ in str or bytes subclasses. Currently
> defining __fspath__ in str or bytes subclasses doesn't have any effect.
>
> I don't know a reasonable use case for this feature. The __fspath__ method
> of str or bytes subclasses returning something not equivalent to self looks
> confusing to me.

Yes, that would be another reason.

Only when Python drops support for strings as paths, can
people start writing such subclasses. I'm sure many
would now say dropping str/bytes path support won't even happen in
Python 4.

-- Koos


-- 
+ Koos Zevenhoven + http://twitter.com/k7hoven +


More information about the Python-ideas mailing list