Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40868

itertools.filterfalse - what is it good for

From Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
Subject itertools.filterfalse - what is it good for
Date 2013-03-08 16:45 +0000
Newsgroups comp.lang.python
Message-ID <mailman.3087.1362761126.2939.python-list@python.org> (permalink)

Show all headers | View raw


Dear all,
can anybody point out a situation where you really need itertools.filterfalse() ?
So far, I couldn't think of a case where you couldn't replace it with a
generator expression/if combination.
e.g.,

a=filterfalse(lambda x: x%2, range(1,101))
b=(i for i in range(1,101) if not i % 2)

do not return the same object type, but otherwise are achieving the same thing.
What am I missing here? For sure filterfalse exists for a reason?

Best,
Wolfgang

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

itertools.filterfalse - what is it good for Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2013-03-08 16:45 +0000
  Re: itertools.filterfalse - what is it good for Neil Cerutti <neilc@norwich.edu> - 2013-03-08 17:02 +0000
  Re: itertools.filterfalse - what is it good for Miki Tebeka <miki.tebeka@gmail.com> - 2013-03-09 12:30 -0800
  Re: itertools.filterfalse - what is it good for Miki Tebeka <miki.tebeka@gmail.com> - 2013-03-09 12:30 -0800

csiph-web