[Python-ideas] PEP 428: poll about the joining syntax
ericsnowcurrently at gmail.com
Thu Oct 11 04:34:36 CEST 2012
On Oct 8, 2012 5:35 PM, "Eric Snow" <ericsnowcurrently at gmail.com> wrote:
> On Mon, Oct 8, 2012 at 12:47 PM, Antoine Pitrou <solipsis at pitrou.net>
> > - `p[q]` joins path q to path p
> > - `p + q` joins path q to path p
> > - `p / q` joins path q to path p
> > - `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 +0
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas