[Python-Dev] The path module PEP

Phillip J. Eby pje at telecommunity.com
Wed Jan 25 23:54:04 CET 2006


At 11:25 AM 1/26/2006 +1300, Tony Meyer wrote:
>Against it:
>
>   * Zen: Beautiful is better than ugly. Explicit is better than
>implicit. Readability counts. There should be one-- and preferably
>only one --obvious way to do it.
>
>   * Not every platform that Python supports has '/' as the path
>separator.  Windows, a pretty major one, has '\'.

"/" also works on Windows, and the Python distutils already set the 
precedent of requiring /-separated paths on *all* platforms, converting 
them to os.sep behind the scenes.

I'd also note that using the / operator seems to me to be a big win on 
"beautiful is better than ugly".  Path-joining code is mighty ugly without 
it, and / is more readable as well.

It'd be nice to see the urllib modules grow a URL type supporting this 
operator, among other path operators.

I would also suggest that as with the individual posixpath, ntpath, etc. 
libraries today, we should be able to import NTPath and PosixPath classes 
directly from those modules, for code that needs to manipulate a path for 
some system other than the one it's running on.



More information about the Python-Dev mailing list