frange() question

Tim Golden mail at
Thu Sep 20 15:21:51 CEST 2007

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:


More information about the Python-list mailing list