[Python-ideas] os.path.commonprefix: Yes that old chestnut.

Antoine Pitrou solipsis at pitrou.net
Mon Mar 23 23:09:37 CET 2015


On Mon, 23 Mar 2015 21:33:48 +0000
"Gregory P. Smith" <greg at krypto.org> wrote:
> +1 pathlib would be the appropriate place for the correctly behaving
> function to appear.

Patches welcome :-)

Regards

Antoine.


> 
> os.path.commonprefix()'s behavior would be better off as a str and bytes
> method rather than a crazy function in the os.path library but I doubt
> anyone *really* wants to add more methods to those.
> 
> On Mon, Mar 23, 2015 at 8:25 AM Paul Moore <p.f.moore at gmail.com> wrote:
> 
> > On 23 March 2015 at 14:52, Tal Einat <taleinat at gmail.com> wrote:
> > > On Sat, Mar 21, 2015 at 1:47 PM, Antoine Pitrou <solipsis at pitrou.net>
> > wrote:
> > >> On Fri, 20 Mar 2015 21:41:03 -0700 (PDT)
> > >> Paddy3118 <paddy3118 at gmail.com> wrote:
> > >>>
> > >>> The  fix seems clear: deprecate os.path.commonprefix whilst creating a
> > true
> > >>> os.path.commonpath and str.commonprefix. The deprecated function should
> > >>> hang around and the standard libs modified to switch to the new
> > function(s)
> > >>
> > >> +1 from me.
> > >
> > > +1
> >
> > +1. Maybe adding a commonprefix operation to pathlib would be a good
> > idea as well - using that would avoid the confusion between the
> > deprecated os.path.commonprefix and os.path.commonpath...
> >
> > Paul
> > _______________________________________________
> > Python-ideas mailing list
> > Python-ideas at python.org
> > https://mail.python.org/mailman/listinfo/python-ideas
> > Code of Conduct: http://python.org/psf/codeofconduct/
> >
> 




More information about the Python-ideas mailing list