[Tutor] generator object
monikajg at netzero.net
monikajg at netzero.net
Wed Aug 31 12:31:03 EDT 2016
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 <tutor at python.org>
To: tutor at python.org
Subject: Re: [Tutor] generator object
Date: Wed, 31 Aug 2016 08:56:21 +0100
On 31/08/16 05:12, monikajg at 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 values which can also be of any type.
It might be valid to say that a generator function *is* a generator
object, but I'll leave that distinction to the language lawyers
to debate.
Alan G
_______________________________________________
Tutor maillist - Tutor at python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
____________________________________________________________
Health News 24 (Sponsored by Content.Ad)
Don't Use Botox, Use This Instead: Granny Reveals $39 Method
http://thirdpartyoffers.netzero.net/TGL3241/57c706939da2b6930d55st04duc
More information about the Tutor
mailing list