[Python-ideas] tweaking the file system path protocol

tritium-list at sdamon.com tritium-list at sdamon.com
Tue May 23 18:33:13 EDT 2017



> -----Original Message-----
> From: Python-ideas [mailto:python-ideas-bounces+tritium-
> list=sdamon.com at python.org] On Behalf Of Koos Zevenhoven
> Sent: Tuesday, May 23, 2017 5:31 PM
> To: Serhiy Storchaka <storchaka at gmail.com>
> Cc: python-ideas <python-ideas at python.org>
> Subject: Re: [Python-ideas] tweaking the file system path protocol
> 
> 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


It is highly unlikely that python will ever drop str/bytes support for
dealing with filesystem paths; case and point, they just ADDED bytes support
back for windows filesystem paths.



More information about the Python-ideas mailing list