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
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
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
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*
> -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
>
&
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)
>
> -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
>
&
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*
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
> >
> >
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@
> -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
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
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
13 matches
Mail list logo