[Python-ideas] PEP 428 - object-oriented filesystem paths

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Oct 9 08:02:35 CEST 2012


Nick Coghlan wrote:

> Moving from "os.path.join(a, b, c, d, e)" (or, the way I often write
> it, "joinpath(a, b, c, d, e)") to "a.joinpath(b, c, d, e)" at least
> isn't going backwards, and is more obvious in isolation than "a / b /
> c / d / e".

I think we should keep in mind that we're (hopefully) not going
to see things like "a / b / c / d / e" in real-life code. Rather
we're going to see things like

    backupath = destdir / "archive" / filename + ".bak"

In other words, there should be some clue from the names
that paths are involved, from which it should be fairly
easy to guess what the "/" means.

-- 
Greg



More information about the Python-ideas mailing list