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

Ryan D Hiebert ryan at ryanhiebert.com
Tue Oct 9 01:19:00 CEST 2012


On Oct 8, 2012, at 11:47 AM, Antoine Pitrou <solipsis at 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
+0.5
> - `p.join(q)` joins path q to path p
-1, but +1 to p.append(q)

If we want a p.pathjoin method, it would make sense to me for it to work similar to urllib.parse.urljoin, i.e., if the joined path is absolute, have it replace the path, except possibly for the drive on windows. 

I like to follow any parallels to list that make sense.

Ryan


More information about the Python-ideas mailing list