Re: [Python-ideas] fnmatch.filter_false

2017-05-21 Thread Pavol Lisy
On 5/21/17, Steven D'Aprano wrote: > On Sun, May 21, 2017 at 08:04:04AM +0200, Pavol Lisy wrote: > >> If fnmatch.filter was written to solve performance, isn't calling >> _filtered step back? > > It adds overhead of *one* function call regardless of how many > thousands or

Re: [Python-ideas] fnmatch.filter_false

2017-05-21 Thread Steven D'Aprano
On Sun, May 21, 2017 at 08:04:04AM +0200, Pavol Lisy wrote: > If fnmatch.filter was written to solve performance, isn't calling > _filtered step back? It adds overhead of *one* function call regardless of how many thousands or millions of names you are filtering. And the benefit is that

Re: [Python-ideas] fnmatch.filter_false

2017-05-21 Thread Pavol Lisy
On 5/20/17, Steven D'Aprano wrote: > On Wed, May 17, 2017 at 12:14:05PM -0400, Alex Walters wrote: >> Fnmath.filter works great. To remind people what it does, it takes an >> iterable of strings and a pattern and returns a list of the strings that >> match the pattern. And

Re: [Python-ideas] fnmatch.filter_false

2017-05-20 Thread Steven D'Aprano
On Wed, May 17, 2017 at 12:14:05PM -0400, Alex Walters wrote: > Fnmath.filter works great. To remind people what it does, it takes an > iterable of strings and a pattern and returns a list of the strings that > match the pattern. And that is wonderful > > However, I often need to filter *out*

Re: [Python-ideas] fnmatch.filter_false

2017-05-18 Thread tritium-list
> -Original Message- > From: Python-ideas [mailto:python-ideas-bounces+tritium- > list=sdamon@python.org] On Behalf Of Steven D'Aprano > Sent: Thursday, May 18, 2017 9:01 AM > To: python-ideas@python.org > Subject: Re: [Python-ideas] fnmatch.filter_false > &

Re: [Python-ideas] fnmatch.filter_false

2017-05-18 Thread Steven D'Aprano
On Thu, May 18, 2017 at 12:07:05AM -0400, tritium-l...@sdamon.com wrote: > > At the cost of a slight inefficiency, you could use the pure Python > > equivalent given in the docs: > > > > https://docs.python.org/3/library/fnmatch.html#fnmatch.filter > > > > > > fnmatch.filter(names, pattern) >

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread tritium-list
> -Original Message- > From: Python-ideas [mailto:python-ideas-bounces+tritium- > list=sdamon@python.org] On Behalf Of Steven D'Aprano > Sent: Wednesday, May 17, 2017 9:01 PM > To: python-ideas@python.org > Subject: Re: [Python-ideas] fnmatch.filter_false > &

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread Steven D'Aprano
On Wed, May 17, 2017 at 12:14:05PM -0400, Alex Walters wrote: > Fnmath.filter works great. To remind people what it does, it takes an > iterable of strings and a pattern and returns a list of the strings that > match the pattern. And that is wonderful > > However, I often need to filter *out*

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread אלעזר
32324 > > > > > -Original Message- > > From: tritium-l...@sdamon.com [mailto:tritium-l...@sdamon.com] > > Sent: Wednesday, May 17, 2017 1:19 PM > > To: python-ideas@python.org > > Subject: RE: [Python-ideas] fnmatch.filter_false > > > >

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread tritium-list
ot; )) The first test (modified code) timed at 22.492161903402575, where the second test (unmodified) timed at 19.31892032324 > -Original Message- > From: tritium-l...@sdamon.com [mailto:tritium-l...@sdamon.com] > Sent: Wednesday, May 17, 2017 1:19 PM > To: python-ideas@

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread tritium-list
> -Original Message- > From: Python-ideas [mailto:python-ideas-bounces+tritium- > list=sdamon@python.org] On Behalf Of Oleg Broytman > Sent: Wednesday, May 17, 2017 12:44 PM > To: python-ideas@python.org > Subject: Re: [Python-ideas] fnmatch.filter_false > > On

Re: [Python-ideas] fnmatch.filter_false

2017-05-17 Thread Oleg Broytman
On Wed, May 17, 2017 at 12:14:05PM -0400, Alex Walters wrote: > Fnmath.filter works great. To remind people what it does, it takes an > iterable of strings and a pattern and returns a list of the strings that > match the pattern. And that is wonderful > > However, I

[Python-ideas] fnmatch.filter_false

2017-05-17 Thread Alex Walters
Fnmath.filter works great. To remind people what it does, it takes an iterable of strings and a pattern and returns a list of the strings that match the pattern. And that is wonderful However, I often need to filter *out* the items that match the pattern (to ignore them). In every project that