[Python-ideas] PEP 428 - object-oriented filesystem paths
Greg Ewing
greg.ewing at canterbury.ac.nz
Tue Oct 9 08:11:18 CEST 2012
> On 8 October 2012 20:14, Stefan Krah <stefan at bytereef.org
> <mailto:stefan at bytereef.org>> wrote:
>
> # A bit long
> # My personal objection is that one shouldn't have to state "path"
> in the name: it's not str.stringjoin()
> configdir.joinpath("myprogram")
> configdir.pathjoin("myprogram")
I was just thinking the same thing.
My preference for this at the moment is 'append', notwithstanding
the fact that it will be non-mutating. It's a single, short word, it
avoids re-stating the datatype, and it resonates with the idea of
appending to a sequence of path components.
> # My favorites ('cause my opinion: so there)
> configdir.child("myprogram") # Does sorta' imply IO
Except that the result isn't always a child (the RHS could be
an absolute path, start with "..", etc.)
> configdir.cd("myprogam")
Aaaghh... my brain... the lobotomy does nothing...
--
Greg
More information about the Python-ideas
mailing list