George Trojan wrote:
> A while ago I found somewhere the following implementation of frange():
.
.
.
>      return (limit1 + n*increment for n in range(count))
> 
> I am puzzled by the parentheses in the last line. Somehow they make 
> frange to be a generator:

> But I always thought that generators need a keyword "yield". What is 
> going on here?

That's what's known as a generator expression:

http://docs.python.org/ref/genexpr.html
http://www.python.org/dev/peps/pep-0289/

TJG
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to