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

Gregory P. Smith greg at krypto.org
Mon Mar 23 22:33:48 CET 2015


+1 pathlib would be the appropriate place for the correctly behaving
function to appear.

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/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150323/6ab67e40/attachment-0001.html>


More information about the Python-ideas mailing list