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

Ben Finney ben+python at benfinney.id.au
Tue Oct 9 04:54:05 CEST 2012


Antoine Pitrou <solipsis at pitrou.net>
writes:

> 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:

I hope you count U+2212 MINUS SIGN and not only U+002D HYPHEN-MINUS :-)

> - `p[q]` joins path q to path p

−1. Ugly and counter-intuitive. Bracket syntax is for accessing items of
a collection.

> - `p + q` joins path q to path p

+1. Works as I'd expect it to work, and is easily discovered.

> - `p / q` joins path q to path p

−1. ‘/’ as a Python operator strongly connotes “division”, and this
isn't it.

> - `p.join(q)` joins path q to path p

+1. Explicit and clear.

> (you can include a rationale if you want, but don't forget to vote :-))

Thanks for the poll.

-- 
 \            “The whole area of [treating source code as intellectual |
  `\    property] is almost assuring a customer that you are not going |
_o__)               to do any innovation in the future.” —Gary Barnett |
Ben Finney




More information about the Python-ideas mailing list