p + q +1
This is a familiar notation to any developer and its been used widely.
Regards, Rohit.
On Thu, Oct 11, 2012 at 8:04 AM, Eric Snow ericsnowcurrently@gmail.comwrote:
On Oct 8, 2012 5:35 PM, "Eric Snow" ericsnowcurrently@gmail.com wrote:
On Mon, Oct 8, 2012 at 12:47 PM, Antoine Pitrou solipsis@pitrou.net
wrote:
- `p[q]` joins path q to path p
-1
- `p + q` joins path q to path p
-1
- `p / q` joins path q to path p
-1
- `p.join(q)` joins path q to path p
+1 (with a different name)
I've found Nick's argument against operators-from-day-1 to be convincing, as well as his argument against join() or any other name already provided by string/sequence APIs.
Changing my vote:
p[q] -1 p + q -1 p / q +0 p.pathjoin() +1
A method is essential, regardless of the color the bikeshed ends up. As far as operators go, / is the only option here that doesn't conflict with string/collection APIs. The alternative has an adverse impact on subclassing and on future design choices on the path API. This goes for the method name too.
-eric
Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas