[Python-ideas] PEP 428 - object-oriented filesystem paths
Massimo Di Pierro
massimo.dipierro at gmail.com
Tue Oct 9 16:57:12 CEST 2012
This is an excellent point. I change my vote to using the / operator (wait, do I even any right to vote not his?).
On Oct 9, 2012, at 9:30 AM, Michele Lacchia wrote:
>
> >
> > A reason *not* to use '+' is that it would violate associativity
> > in some cases, e.g.
> >
> > (path + "foo") + "bar"
> >
> > would not be the same as
> >
> > path + ("foo" + "bar")
> >
>
>
> I am missing something. Why not?
>
> Because the result would be (respectively): path/foo/bar and path/foobar.
> In the second example the two strings would be concatenated and only
> then joined to the path.
> This is a very good argument against the + operator!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121009/515462f5/attachment.html>
More information about the Python-ideas
mailing list