Serhiy Storchaka added the comment: > 1) what do you think about "os.path is posixpath" vs just checking os.name == > 'posix' as I suggested earlier?
Currently os.path is posixpath if and only if os.name == 'posix'. But this can be changed in future. I think it is safer to the current check. The posixpath module doesn't contain classes, enums or namedtuples, it's import is fast. And it would be safer to keep the check in the function rather than move it at module level. > What do you think of a keyword argument like 'case' to both filter and > filterfalse that, when True, would make these functions behave equivalently to > [n for n in names if fnmatchcase(n, pattern)] This is a different issue. fnmatch.filter() was added for speeding up glob.glob() (see issue409973). I don't know whether there is a good use case for filtercase(). > isn't normcase in both posixpath and ntpath doing isinstance(str, bytes) > checks that are redundant with os.fspath? Good catch! It seems to me that they are redundant. Please open a new issue for this. ---------- title: Add fnmatch.filter_false function -> Add fnmatch.filterfalse function _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30413> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com