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


Groups > comp.lang.python > #2745

Re: Is the function filter deprecated?

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news2.glorb.com!news-out.octanews.net!indigo.octanews.net!auth.brown.octanews.com.POSTED!not-for-mail
From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.lang.python
Subject Re: Is the function filter deprecated?
References <mailman.88.1302132053.9059.python-list@python.org> <4d9d0dfe$0$29977$c3e8da3$5496439d@news.astraweb.com>
Date Wed, 06 Apr 2011 22:23:30 -0700
Message-ID <7xd3kyprcd.fsf@ruckus.brouhaha.com> (permalink)
Organization Nightsong/Fort GNOX
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:y1VQAvNCQfgksg6jcLRGcV/99QU=
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Lines 8
NNTP-Posting-Date 07 Apr 2011 00:23:30 CDT
X-Complaints-To abuse@octanews.net
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:2745

Show key headers only | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info> writes:
> filter(func, *seqs) -> [x for x in itertools.chain(*seqs) if func(x)]
> although I suppose functional programming purists might object :)

Maybe you really want

   filter(func, chain.from_iterable(seqs))
   

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


Thread

Is the function filter deprecated? Jabba Laci <jabba.laci@gmail.com> - 2011-04-06 19:20 -0400
  Re: Is the function filter deprecated? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-04-07 01:06 +0000
    Re: Is the function filter deprecated? Paul Rubin <no.email@nospam.invalid> - 2011-04-06 22:23 -0700

csiph-web