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

Zachary Ware zachary.ware+pyideas at gmail.com
Tue Oct 9 03:05:35 CEST 2012


Speaking as a relatively inexperienced user (whose opinions should
justly be given little weight as such),

> - `p[q]` joins path q to path p
-1: Doesn't make sense at first glance

> - `p + q` joins path q to path p
-1: For reasons stated elsewhere by several others; Path + (Path or
str) != str + str

> - `p / q` joins path q to path p
+1: Short, makes sense if you can get your brain past "/ in Python
means 'divide'"

> - `p.join(q)` joins path q to path p
+1: Except it needs a different name, for the same reasons as +

What about p.unite(q)? The one word definition of 'join' is 'unite'
and it's definitely not used by str, and I don't know of anywhere else
that it is used. And it's only one extra character instead of the 4 of
'pathjoin' or 'joinpath'.



More information about the Python-ideas mailing list