[Python-ideas] os.path.join

Paul Moore p.f.moore at gmail.com
Thu Oct 31 13:56:53 CET 2013


On 31 October 2013 10:30, anatoly techtonik <techtonik at gmail.com> wrote:
>> I agree it might be confusing but it's pretty explicitly documented.
>
> Yes. It is confusing.
>
> 1. How often the operations to join absolute paths is needed?

Infrequently, but occasionally. Usually the first argument will be a
fixed value which is a "base path" and the second will be a
user-supplied (or similar) value which is to be interpreted as
relative to the base, unless it's an absolute path when it's to be
used unchanged.

> 2. What is expected result of this operation?

Exactly what Python currently does.

> For me, as a user, the answer to 1 is 'never', for 2 I'd expect 2nd
> path to be treated as relative one. Thinking about this as 2nd path is
> an absolute path from the mountpoint specified in the 1st.

I would never want this behaviour in any real application I have encountered.

Paul


More information about the Python-ideas mailing list