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

Nick Coghlan ncoghlan at gmail.com
Mon Oct 8 21:24:03 CEST 2012

On Tue, Oct 9, 2012 at 12:34 AM, Guido van Rossum <guido at python.org> wrote:
> On Mon, Oct 8, 2012 at 11:56 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>> Admitted, although I think the potential for confusion is smaller
>> than with "+" (I can't really articulate why, it's just that I fear
>> one much less than the other :-)).
> Personally I fear '+' much more -- to me, + can be used to add an
> extension without adding a new directory level. If we *have* to
> overload an operator, I'd prefer p/q over p[q] any day.

Yes, of all the syntactic shorthands, I also favour "/". However, I'm
also a big fan of starting with a minimalist core and growing it.
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".


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list