New submission from Andrés Delfino <adelf...@gmail.com>:

Both fnmatch.fnmatchase and fnmatch.filter (in Unix) do not support path-like 
objects.

This is inconvenient, for example, when taking advantage of os.scandir and 
working with os.DirEntry objets.

Also, fnmatch.filter in Windows does support path-like objects, since it uses 
os.path.normcase (which works with path-like objects), so the change for Unix 
would add consistency.

I propose for both functions to accept path-like objects, and in the case of 
fnmatch.filter, to return the path-like object if it matches the pattern (as it 
does now for Windows).

----------
components: Library (Lib)
messages: 330992
nosy: adelfino
priority: normal
severity: normal
status: open
title: Add support for __fspath__ to fnmatch.fnmatchase and filter
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35396>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to