Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?) Date: Tue, 22 Mar 2016 15:49:12 +0200 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: <8737rvxs89.fsf@elektro.pacujo.net> <56e7483d$0$1608$c3e8da3$5496439d@news.astraweb.com> <56f09973$0$1601$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="305c68510616a2e7ac08bcd2ff1598bd"; logging-data="2771"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rV/ymkp+bHJuY3Kb6pxlthn5N4fcoTXU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:3Lh+O6NwO3uxBQnzsq7JTdIR9Ts= sha1:BaheRVS69CB1zCtuXhnbxG9wKf4= Xref: csiph.com comp.lang.python:105486 Chris Angelico writes: > And yeah, the import is an option, but if I'm trying to explain stuff > to people, it's usually easier to grab a genexp (full flexibility, but > the complexity) than to play around with importing. When the function > you want exists and returns true for the things you want, filter() has > a big win; for any other situation, it's not worth reaching to > itertools for a specific solution when the generic one will cover this > and every other case. True. Filtering is so simple. The big win for me has been itertools.groupby. The other stuff I mostly play with for amusement. But hey, nothing frivolous in amusement!