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/2003-October/039292.html below:

[Python-Dev] Re: accumulator display syntax

[Python-Dev] Re: accumulator display syntax [Python-Dev] Re: accumulator display syntaxGuido van Rossum guido at python.org
Wed Oct 22 12:05:58 EDT 2003
> I had a similar thought about 5 minutes after turning my computer off last 
> night. The alternative I came up with was:
> 
>    y = (from result = 0.0 do result += x**2 for x in values if x > 0)

I think you're aiming for the wrong thing here; I really see no reason
why you'd want to avoid writing this out as a real for loop if you
don't have an existing accumulator function (like sum()) to use.

--Guido van Rossum (home page: http://www.python.org/~guido/)

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