Don't `yield` on non generator functions. Fixes #3908.

Additionally, simplified match logic, replaced 3*`==` by `in`.
Merge pull request #3923 from s0undt3ch/issues/3908

Don't `yield` on non generator functions. Fixes #3908.