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

Dmi Baranov report at bugs.python.org
Wed May 29 12:32:36 CEST 2013


Dmi Baranov added the comment:

> Also, as mentioned, what you want to hide is not necessarily
> well-defined. For example, under Unix you might want
> to hide "*~" files.

Yes, and instead of adding another parameters, something like that:

os.listdir(path, show_hidden=False, hidden_files_mask='*~', but_show_directories=True, something_etc=None)

I suggest leaving the "hidden files" logic outside of stdlib (in the end-user code). Welcome to `glob` / `fnmatch` modules :-)

----------

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


More information about the Python-bugs-list mailing list