Closures in leu of pointers?
Terry Reedy
tjreedy at udel.edu
Sun Jun 30 02:11:28 EDT 2013
On 6/30/2013 1:46 AM, Ian Kelly wrote:
> On a related note, I think that generator functions should in some way
> be explicitly marked as such in the declaration, rather than needing
> to scan the entire function body for a yield statement to determine
> whether it's a generator or not.
I agree that one should not have to scan. The doc string, which should
be present should start 'Return a generator that yields ...' or even
'Generate ...'. Of course, then non-generator functions should not start
the same way. The first option should be non-ambiguous.
--
Terry Jan Reedy
More information about the Python-list
mailing list