[issue18087] os.listdir don't show hidden option

Antoine Pitrou report at bugs.python.org
Wed May 29 12:00:19 CEST 2013


Antoine Pitrou added the comment:

I don't really understand, since this is an easy one-liner:

[n for n in os.listdir(...) if not n.startswith(".")]

Also, as mentioned, what you want to hide is not necessarily well-defined. For example, under Unix you might want to hide "*~" files.
So I don't think os.listdir() should grow such an option, it's up to user code to decide what should be displayed / reported to the user.

(or in other words: while Python provides filesystem-access functions, Python is not a shell)

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18087>
_______________________________________


More information about the Python-bugs-list mailing list