16 Nov
2014
16 Nov
'14
5:05 p.m.
Chris Angelico wrote:
if you call on someone else's generator, and that someone hasn't applied the __future__ directive, you'll be in the current situation of not being able to distinguish 'return' from 'raise StopIteration'. But for your own generators, you can guarantee that they're distinct.
This suggests that the use of a __future__ directive is not really appropriate, since it can affect code outside of the module with the __future__ directive in it. -- Greg