[path-PEP] Path inherits from basestring again

Tony Meyer t-meyer at ihug.co.nz
Mon Jul 25 05:28:32 CEST 2005


[...]
> Open issues:
[...]
> What about path * 4?

If you keep the current join meaning of __div__, then assigning any sort of
multiplication meaning to __mul__ would not be a good idea, IMO.  It's
natural to expect that __div__ and __mul__ are opposites.  I suppose this
means that you could make __mul__ mean split (and f(*tuple) does do
splitting of a sort), but I don't know what splitting by 4 would mean,
necessarily.

Do people really like using __div__ to mean join?  On the python-dev
discussion, Just van Rossum spoke out against it, but there weren't (IIRC)
any other comments, either pro or con.

I'm -1, myself.  Apart from TIOOTDI, it doesn't seem a natural use for the
'/' character.  I suppose that it looks nice, when one is used to posix
paths, but not everyone is, and I'm sure that more people would expect some
sort of division (the exact opposite!) than join.

=Tony.Meyer




More information about the Python-list mailing list