[path-PEP] Path inherits from basestring again
reinhold-birkenfeld-nospam at wolke7.net
Mon Jul 25 09:26:44 CEST 2005
Tony Meyer wrote:
>> 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,
Yes. I think I'll not attach any meaning to it. If used, it will have the same
meaning as string * 4.
> 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 not too happy with it, too, but do we have alternatives? As paths are strings,
we can hardly override the '+' operator, so there's not much operators left.
Of course, one can use joinwith() if he doesn't like '/'.
More information about the Python-list