On Mon, Oct 8, 2012 at 3:47 PM, Antoine Pitrou firstname.lastname@example.org wrote:
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) ;-) ;-)
(you can include a rationale if you want, but don't forget to vote :-))
-- Software development and contracting: http://pro.pitrou.net
Python-ideas mailing list Pythonemail@example.com http://mail.python.org/mailman/listinfo/python-ideas