Dev] / as path join operator (original) (raw)
Stephen J. Turnbull stephen at xemacs.org
Thu Jan 26 05:21:10 CET 2006
- Previous message: [Python-Dev] / as path join operator
- Next message: [Python-Dev] / as path join operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Steven" == Steven Bethard <steven.bethard at gmail.com> writes:
Steven> My only fear with the / operator is that we'll end up with
Steven> the same problems we have for using % in string formatting
Steven> -- the order of operations might not be what users expect.
Besides STeVe's example, (1) I think it's logical to expect that
Path('home') / 'and/or'
points to a file named "and/or" in directory "home", not to a file named "or" in directory "home/and".
(2) Note that '/' is also the path separator used by URIs, which RFC 2396 gives different semantics from Unix. Most of my Python usage to date has been heavily web-oriented, and I'd have little use for / unless it follows RFC 2396. By that, I mean that I would want the / operator to treat its rhs as a relative reference, so the result would be computed by the algorithm in section 5.2 of that RFC. But this is not correct (realpath) semantics on Unix.
-- School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN Ask not how you can "do" free software business; ask what your business can "do for" free software.
- Previous message: [Python-Dev] / as path join operator
- Next message: [Python-Dev] / as path join operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]