RE: hachyderm.io/@nedbat/116150179

The answer to the mystery: because my function had a `yield` in it, it was compiled as a generator. But executing the function never ran `yield`, so iterating it produced an empty sequence. The value from the return statement is ignored.

TBH, I know there is a way to get the returned value, but I have never needed to, and I don't know how.

The solution was to delete the code after the return.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://hachyderm.io/users/nedbat/statuses/116150314888206259 on your instance and quote it. (Note that quoting is not supported in Mastodon.)