[Python-ideas] PEP 428: poll about the joining syntax
MRAB
python at mrabarnett.plus.com
Mon Oct 8 21:22:06 CEST 2012
On 2012-10-08 19:47, Antoine Pitrou 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. I would much prefer subscripting to be used to slice paths, e.g.
p[-1] == os.path.basename(p).
> - `p + q` joins path q to path p
+0. I would prefer that to mean "join without directory separator",
e.g. Path("/foo/bar") + ".txt" == Path("/foo/bar.txt").
> - `p / q` joins path q to path p
+1. Join with directory separator, e.g. Path("/foo") / "bar" ==
Path("/foo/bar").
> - `p.join(q)` joins path q to path p
+0
>
> (you can include a rationale if you want, but don't forget to vote :-))
>
More information about the Python-ideas
mailing list