[Python-ideas] PEP 428 - object-oriented filesystem paths

Stephen J. Turnbull stephen at xemacs.org
Sun Oct 7 10:36:11 CEST 2012


Greg Ewing writes:
 > Stephen J. Turnbull wrote:
 > 
 > > On the other hand, `p + Path('foo')` and `Path('foo') + p` (where p is
 > > a Path, not a string) both seem reasonable to me.
 > 
 > I don't like the idea of using + as the path concatenation
 > operator, because
 > 
 >     path + ".c"
 > 
 > is an obvious way to add an extension or other suffix to a
 > filename, and it ought to work.

I don't have a problem with it because I don't append extensions as
often as I substitute, and because I don't think of paths as strings.

I think of (some) strings as representatives of paths.




More information about the Python-ideas mailing list