A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2012-October/121921.html below:

[Python-Dev] benchmarks: Force map to a list to guarantee the calculations are performed under

[Python-Dev] benchmarks: Force map to a list to guarantee the calculations are performed underBrett Cannon brett at python.org
Mon Oct 1 01:18:26 CEST 2012
On Sun, Sep 30, 2012 at 7:11 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Mon,  1 Oct 2012 01:00:42 +0200 (CEST)
> brett.cannon <python-checkins at python.org> wrote:
> > http://hg.python.org/benchmarks/rev/e9f911fd9bd3
> > changeset:   184:e9f911fd9bd3
> > user:        Brett Cannon <brett at python.org>
> > date:        Sun Sep 30 19:00:32 2012 -0400
> > summary:
> >   Force map to a list to guarantee the calculations are performed under
> > Python 3.
> [...]
> >  def eval_times_u(func, u):
> > -    return map(func, ((i,u) for i in xrange(len(list(u)))))
> > +    return list(imap(func, ((i,u) for i in xrange(len(list(u))))))
>
> Ugh, can't you use a list comprehension instead? The code would be much
> more idiomatic.
>

Done. Just went with the fastest fix without thinking.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120930/9f2a3778/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4