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

Senthil Kumaran senthil at uthcode.com
Tue Oct 9 09:10:47 CEST 2012

Antoine Pitrou <solipsis at pitrou.net> wrote:

> - `p[q]` joins path q to path p


I think, this is listed as example in PEP 428.
I had to look it up to understand. Not intuitive (to me atleast) as join.

> - `p + q` joins path q to path p


I would be +1. But in the PEP you have listed that we need a way
separate path behaviors from confusing with builtins
Though it provides a lot of convenience, it can be confused with str
behaviors or other object behaviors.

> - `p / q` joins path q to path p


> - `p.join(q)` joins path q to path p


> `p.pathjoin(q)`


It is very explicit and hard to get it wrong.

More information about the Python-ideas mailing list