On 31/08/16 23:24, Alan Gauld via Tutor wrote:
> Then I tried
> ...
> x = list(2)
Should be
list(gen(2))
I hope that was obvious...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.
Alan Gauld via Tutor wrote:
> On 31/08/16 08:56, Alan Gauld via Tutor wrote:
>
>> A generator function can return any kind of object including
>> basic types like numbers, bool etc.In addition, a generator
>> function yields values which can also be of any type.
>
> Hmmm.
> After reading Steven'
On 31/08/16 08:56, Alan Gauld via Tutor wrote:
> A generator function can return any kind of object including
> basic types like numbers, bool etc.In addition, a generator
> function yields values which can also be of any type.
Hmmm.
After reading Steven's response I played around a bit.
While a
Aaron Maxwell made a clear distinction between generator function and that it
returns a generator object. He emphasized that a couple of times.
-- Original Message --
From: Alan Gauld via Tutor
To: tutor@python.org
Subject: Re: [Tutor] generator object
Date: Wed, 31 Aug 2016 08
Thank you everybody. This was very helpful
Monika
-- Original Message --
From: Steven D'Aprano
To: tutor@python.org
Subject: Re: [Tutor] generator object
Date: Wed, 31 Aug 2016 21:24:57 +1000
On Wed, Aug 31, 2016 at 04:12:24AM +, monik...@netzero.net wrote:
>
> S
On Wed, Aug 31, 2016 at 04:12:24AM +, monik...@netzero.net wrote:
>
> So generator function returns generator object according to Aaron
> Maxwell. But does this mean that each time yields "returns" it is a
> generator object? So if there are 5 yield "returns" there are 5
> generator objects
monik...@netzero.net wrote:
> So generator function returns generator object according to Aaron Maxwell.
It's always nice to give a link or a quote.
> But does this mean that each time yields "returns" it is a generator
> object? So if there are 5 yield "returns" there are 5 generator objects?
>
On 31/08/16 05:12, monik...@netzero.net wrote:
So generator function returns generator object according to Aaron Maxwell.
I don't believe that's correct.
A generator function can return any kind of object including
basic types like numbers, bool etc.In addition, a generator
function yields va