https://pantsbuild.org/ logo
#development
Title
# development
h

hundreds-breakfast-49010

11/07/2019, 12:23 AM
@aloof-angle-91616 if you use yield once in a method, you turn the whole method into a python generator object, so that makes some sense - but python generator objects can still
return
if you've used
yield
before, can't they?
👍 1
h

hundreds-father-404

11/07/2019, 12:24 AM
Yes. They can still
return
. I don't understand the semantics of that tho
w

witty-crayon-22786

11/07/2019, 12:30 AM
they can't return with a value
only a bare return, which is "end of iteration"
👍 1
the python parser checks for
yield
and
return value
being mixed
and will explode
h

happy-kitchen-89482

11/07/2019, 12:37 AM
It does explode, but the error message is not as informative as this thread has been 🙂 Thanks!