Let fnmatch.filter accept a tuple of patterns

Frequently, while globbing, one needs to work with multiple extensions. I’d like to propose for fnmatch.filter to handle a tuple of patterns instead of just one pattern, as a first step for glob.i?glob to accept multiple patterns as well.

Here is the implementation I came up with:

https://github.com/python/cpython/compare/master...andresdelfino:fnmatch-multiple-patterns?expand=1

If this is deemed reasonable, I’ll write tests and documentation updates.

“instead” can be misleading. I’m proposing for filter to accept either a str or a tuple, just like str.startswith does.

The Github link about doesn’t work for me.

Since not all discussions are happening here, you may want to call attention to this topic on the python-ideas mailing list.

Hi, Juancarlo! Thanks for replying.

I did sent a mail to python-ideas back at the time: https://groups.google.com/d/msg/python-ideas/5hLsUL4xLY4/Pw3n3M9NAgAJ

The feedback wasn’t good so I ended up deleting the implementation in my repository. It’s something trivial, and I’d write it again if core devs see the need for it.

It seems that the old links lead to NULL. How about starting the discussion about the idea all over again?