[Python-Dev] PEP dircache.py core modification

Guido van Rossum guido@digicool.com
Fri, 16 Mar 2001 21:42:29 -0500


Sorry, I see no merit in your proposal [to add "." and ".." back into
the output of os.listdir()].  You are overlooking the fact that the os
module in Python is intended to be a *portable* interface to operating
system functionality.  The presence of "." and ".." in a directory
listing is not supported on all platforms, e.g. not on Macintosh.

Also, my experience with using os.listdir() way back, when it *did*
return "." and "..", was that *every* program using os.listdir() had
to be careful to filter out "." and "..".  It simply wasn't useful to
include these.

--Guido van Rossum (home page: http://www.python.org/~guido/)