PEP on path module for standard library

Neil Hodgson nyamatongwe+thunder at gmail.com
Thu Jul 21 20:48:47 EDT 2005


Reinhold Birkenfeld:

> And it is much more "Pythonic" in my eyes. Though that word may be inaccurate
> when it comes from someone else that Guido, I feel that endless chains of
> '[os.path.join(os.path.join(z, "a"), x) for x in os.path.listdir(os.path.join(z, "a") if os.path.isfile(os.path.join(....
> are not qualified as being Pythonic.

    I like Path but the above is trying too hard to be poor code. 
os.path.join takes more than 2 arguments, so that should be
[os.path.join(z, "a", x) for x in os.path.listdir(os.path.join(z, "a") 
if os.path.isfile(os.path.join(....

    Neil



More information about the Python-list mailing list