[issue30413] Add fnmatch.filterfalse function

Wolfgang Maier report at bugs.python.org
Mon May 22 04:41:37 EDT 2017


Wolfgang Maier added the comment:

Yet another thing I just realized (sorry for being so annoying):

With os.normcase calling os.fspath in 3.6+ it is not really a NOP anymore even on posix. As a consequence, you can now do some weird things with fnmatch: in all cases, and only in these, where the module *does* call normcase you can pass in Path-like objects as the names.
This works with fnmatch.fnmatch on all platforms, never for fnmatchcase, and platform-dependently (on Windows, but not on posix platforms) for filter/filterfalse.
It's mostly that last case that worries me because it makes it easy to accidentally write code that is not platform-independent.

Also note that you can also pass a Path-like object as pat everywhere except in fnmatchcase.

----------

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


More information about the Python-bugs-list mailing list