I’ve deleted two previous posts, which was misleading.
Since my code had to be a part of a generator function, we should have agreed explicitly that we were writing the same part of a same generator function, so @pf_moore would have written return (yield from ret_value())
on the final line of his code. It was my mistake to assume such an agreement.
(In the deleted posts, I tried to examine the equivalence of return ret_value()
and return (yield from ret_value())
under the assumption that the former was a part of an ordinary (i.e., non-generator) function. However, codes cannot generally be compared between a function and a generator function even if all other parts were identical (so we have no other yield
expression in particular).)