You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to implement this (see my generator branch for progress). Should Iterator still be allowed as return type of a function in case Generator's send_type and return_type are None?
Activity
spkersten commentedon May 2, 2015
I'm trying to implement this (see my generator branch for progress). Should
Iteratorstill be allowed as return type of a function in caseGenerator'ssend_typeandreturn_typeareNone?JukkaL commentedon May 3, 2015
If a function has
Generatoras the return type, it should not return anIterator, asIteratormay not have thesendandthrowmethods.gvanrossum commentedon Jan 13, 2016
See also #695 and #1011 (at least one of these three is a duplicate).
FWIW I think Sander's question is whether this is still allowed:
or whether all generators must be declared as Generator. I believe this example should still be valid (but callers should not call send() or throw().)
JukkaL commentedon Jan 14, 2016
Yeah, an
Iteratorreturn type should still be fine. I was confused above about the question.gvanrossum commentedon Jan 15, 2016
Also closed by #1128.