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

Nick Coghlan ncoghlan at gmail.com
Tue Oct 9 10:31:42 CEST 2012


On Tue, Oct 9, 2012 at 1:22 PM, INADA Naoki <songofacandy at gmail.com> wrote:
> -1 on `pathjoin`.  `Path.pathjoin` is ugly.
> The `urljoin()` is OK because it is just a function.

Hmm, this is a *very* interesting point. *All* of the alternatives
presented are mainly replacements for just doing this:

Path(p, q)

And if you want a partially applied version, that's just:

prefix = functools.partial(Path, p)

So perhaps the right answer for the initial API is: no method, no
operator, just use the constructor?

The counterargument is that this approach doesn't let "p" control the
return type the way a method or operator does, though.

It does suggest a whole new class of verbs though, like "make" or "build".

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list