[Python-Dev] / as path join operator (was: Re: The path module PEP)

Barry Warsaw barry at python.org
Thu Jan 26 04:51:08 CET 2006


On Thu, 2006-01-26 at 12:51 +1300, Tony Meyer wrote:
> [John J Lee]
> > But it's a very readable way to write a common operation.  Perhaps one
> > reason the discrepancy you point out doesn't bother me is that  
> > division is
> > the least-used of the +-*/ arithmetic operations.
> 
> Do you have evidence to back that up?  It seems a strange claim.   
> Outside of doing 'maths-y' work, I would think I'd use + most (but  
> for strings), then / (for percentages).

I haven't followed the entire thread (I'll try to find time to catch up)
but while I think using __div__ to mean path concatenation is cute, I'm
not sure I'd like to see it all over the place.  It does seem awfully
"FAST" ("facinating and stomach turning" to use a term from years ago).

What I don't like about os.path.join() having to import os and having to
type all those characters over and over again.  What I /like/ about
os.path.join is that you can give it a bunch of path components and have
it return the correctly joined path, e.g. os.path.join('a, 'b', 'c').
That seems more efficient than having to create a bunch of intermediate
objects.

All in all, I'd have to say I'm -0 on __div__ for path concatenation.

-Barry


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20060125/763847fb/attachment.pgp 


More information about the Python-Dev mailing list