[Python-Dev] The path module PEP
Tony Meyer
t-meyer at ihug.co.nz
Wed Jan 25 23:25:57 CET 2006
> Remove __div__ (Ian, Jason, Michael, Oleg)
>
> This is one of those where everyone (me too) says "I don't care either
> way." If that is so, then I see no reason to change it unless someone
> can show a scenario in which it hurts readability. Plus, a few people
> have said that they like the shortcut.
>
> * http://mail.python.org/pipermail/python-list/2005-July/292251.html
> * http://mail.python.org/pipermail/python-dev/2005-June/054496.html
> * http://mail.python.org/pipermail/python-list/2005-July/291628.html
> * http://mail.python.org/pipermail/python-list/2005-July/291621.html
Well, if you include the much larger discussion on python-list,
people (including me) have said that removing __div__ is a good
idea. If it's included in the PEP, please at least include a
justification and cover the problems with it. The vast majority of
people (at least at the time) were either +0 or -0, not +1. +0's are
not justification for including something.
Against it:
* Zen: Beautiful is better than ugly. Explicit is better than
implicit. Readability counts. There should be one-- and preferably
only one --obvious way to do it.
* Not every platform that Python supports has '/' as the path
separator. Windows, a pretty major one, has '\'. I have no idea
what various portable devices use, but there's a reasonable chance
it's not '/'.
* It's being used to mean "join", which is the exact opposite
of /'s other meaning ("divide").
* Python's not Perl. We like using functions and not symbols.
> Renaming methods because of PEP 8 (Gustavo, Ian, Jason)
>
> I'm personally not keen on that. I like most of the names as they
> are. abspath(), joinpath(), realpath() and splitall() looks so much
> better than abs_path(), join_path(), real_path() and split_all() in my
> eyes. If someone like the underscores I'll add it to Open Issues.
+1 to following PEP 8. These aren't built-ins, it's a library
module. In addition to the PEP, underscores make it much easier to
read, especially for those for whom English is not their first language.
=Tony.Meyer
More information about the Python-Dev
mailing list