Yield comprehension

That’s interesting, but I don’t think so that much, since

yield x for x in inner_generator

lacks the keyword from. The idea for the expression is that the statement consisting of it should be equivalent to

for x in inner_generator:
    yield x

(in this sense, it’s an “expression form” of this statement) and you can see the difference of this statement from yield from inner_generator. (E.g., the sent value yield x isn’t sent to inner_generator.)

Thanks for the clarification.

With return, elif may still be better than if. In general, a more versatile syntax (e.g., many if statements > one if statement (if ... elif ... ...) > a conditional expression) can indicate only a less specific intention. Indication of a more specific intention would help, especially when the code fails to follow the intention. It’s better when more of the intention is enforced by the syntax.