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

Mathias Panzenböck grosser.meister.morti at gmx.net
Mon Oct 8 23:39:22 CEST 2012


`p[q]`           0
`p + q`         -1
`p / q`         +0
`p.join(q)`     +1
`p.pathjoin(q)` +0

Where .join/.pathjoin shall take argument lists. The arguments my be path objects or strings.

Example usage (where filename is a string):

 >>> prefix.join(some,path,components,filename+".txt")

I'm against + because how would you do the example above? Because this:

 >>> prefix + some + path + components + filename + ".txt"

would do something different than this:

 >>> prefix + some + path + components + (filename + ".txt")

Which might surprise a user and is in any case confusing.



More information about the Python-ideas mailing list