This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author wolma
Recipients serhiy.storchaka, steven.daprano, wolma
Date 2017-05-21.19:31:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1495395114.94.0.631454096671.issue30413@psf.upfronthosting.co.za>
In-reply-to
Content
@serhiy: my bad! I just hadn't realized this behavior of the original.
With this requirement I cannot see any simpler solution than Steven's.

Some other questions though to everyone involved:
1) what do you think about "os.path is posixpath" vs just checking os.name == 'posix' as I suggested earlier?

2) speaking of missing functionality in filter:
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)]
The default would be False, of course. I know this would be inconsistent in terms of argument vs separate functions, but it is easy to explain and learn and without it Windows users of filter/filterfalse would really suffer from the much poorer performance due to the slow normcase call (even slower now with the new fspath protocol) even if they pass in normalized names already.

3) not directly related to this issue, but I came across it in this context:

isn't normcase in both posixpath and ntpath doing isinstance(str, bytes) checks that are redundant with os.fspath? Is this oversight or am I missing something again?
History
Date User Action Args
2017-05-21 19:31:55wolmasetrecipients: + wolma, steven.daprano, serhiy.storchaka
2017-05-21 19:31:54wolmasetmessageid: <1495395114.94.0.631454096671.issue30413@psf.upfronthosting.co.za>
2017-05-21 19:31:54wolmalinkissue30413 messages
2017-05-21 19:31:54wolmacreate