[Python-ideas] Better stdlib support for Path objects

Antoine Pitrou solipsis at pitrou.net
Tue Oct 7 20:59:26 CEST 2014


On Tue, 7 Oct 2014 14:57:03 -0400
Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Mon, Oct 6, 2014 at 7:58 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> > Not inheriting from built-in classes such as str, list or tuple
> > was one of the design points of pathlib. It will not change in the
> > future ;-)
> >
> > PEP 428 outlines this, but you can probably find a more detailed
> > discussion in the python-ideas archive.
> >
> 
> See also rejected PEP 355: "Subclassing from str is a particularly bad
> idea; many string
> operations make no sense when applied to a path."
> 
> http://legacy.python.org/dev/peps/pep-0355/
> 
> (I would add that many str operations make no sense - period, so
> propagating them into newer designs would be a mistake.)

Thanks for the reference. It is indeed useful to know where we are
coming from here. Trying to mimick str has already been tried in the
past.

Regards

Antoine.




More information about the Python-ideas mailing list