On Sat, 2007-09-22 at 18:21 +, John J. Lee wrote:
> Carsten Haese <[EMAIL PROTECTED]> writes:
> > The second half of my post illustrates a difference of opinion about
> > what constitutes a generator function. You state that frange() is not a
> > generator function because it doesn't use yield,
Carsten Haese <[EMAIL PROTECTED]> writes:
> On Sat, 2007-09-22 at 07:27 +, John J. Lee wrote:
>> Carsten Haese <[EMAIL PROTECTED]> writes:
>>
>> > On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote:
>> >> Functions are never generators, senso stricto. There are "generator
>> >> functions",
On Sat, 2007-09-22 at 07:27 +, John J. Lee wrote:
> Carsten Haese <[EMAIL PROTECTED]> writes:
>
> > On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote:
> >> Functions are never generators, senso stricto. There are "generator
> >> functions", which *return* (or yield) generators when you cal
Carsten Haese <[EMAIL PROTECTED]> writes:
> On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote:
>> Functions are never generators, senso stricto. There are "generator
>> functions", which *return* (or yield) generators when you call them.
>
> Actually, a generator function is a function that re
In article <[EMAIL PROTECTED]>,
George Trojan <[EMAIL PROTECTED]> wrote:
> A while ago I found somewhere the following implementation of frange():
>
> def frange(limit1, limit2 = None, increment = 1.):
> """
> Range function that accepts floats (and integers).
> Usage:
> fran
On Thu, 2007-09-20 at 18:55 +, John J. Lee wrote:
> Functions are never generators, senso stricto. There are "generator
> functions", which *return* (or yield) generators when you call them.
Actually, a generator function is a function that returns a generator.
The generator, in turn, is an o
George Trojan <[EMAIL PROTECTED]> writes:
> A while ago I found somewhere the following implementation of frange():
>
> def frange(limit1, limit2 = None, increment = 1.):
> """
> Range function that accepts floats (and integers).
> Usage:
> frange(-2, 2, 0.1)
> frange(10)
>
On Thu, 20 Sep 2007 09:08:17 -0400, George Trojan wrote:
> A while ago I found somewhere the following implementation of frange():
>
> def frange(limit1, limit2 = None, increment = 1.):
> """
> Range function that accepts floats (and integers). Usage:
> frange(-2, 2, 0.1)
> fr
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 generato
A while ago I found somewhere the following implementation of frange():
def frange(limit1, limit2 = None, increment = 1.):
"""
Range function that accepts floats (and integers).
Usage:
frange(-2, 2, 0.1)
frange(10)
frange(10, increment = 0.5)
The returned value i
10 matches
Mail list logo