[Python-ideas] PEP 428: poll about the joining syntax

Andre Roberge andre.roberge at gmail.com
Tue Oct 9 21:32:36 CEST 2012


On Mon, Oct 8, 2012 at 3:47 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

>
> Hello,
>
> Since there has been some controversy about the joining syntax used in
> PEP 428 (filesystem path objects), I would like to run an informal poll
> about it. Please answer with +1/+0/-0/-1 for each proposal:
>
> - `p[q]` joins path q to path p
>
-1    ... semantics too different from usual meaning of [ ]

- `p + q` joins path q to path p
>
-1  ... too problematic with strings...

- `p / q` joins path q to path p
>
+0   ... my brain is hard-wired to see / as division or equivalent (e.g.
quotient groups, etc.)

- `p.join(q)` joins path q to path p
>
+1    .... only remaining choice.  Besides, I think an explicit method
makes more sense.


If paths were only directories, I would have really like
p.cd(q)   [with support for multiple arguments of course]
as everyone (I think) would naturally recognize this...   However, since we
can have file as well, I was trying to think of something to mean
change path p so that it now points to the joining of path p and q ...
and suggest p.goto(q)  ;-)  ;-)

André

>
> (you can include a rationale if you want, but don't forget to vote :-))
>
> Thank you
>
> Antoine.
>
>
> --
> Software development and contracting: http://pro.pitrou.net
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121009/cb509f66/attachment.html>


More information about the Python-ideas mailing list