Issue #1123: Make checks for generator functions without yield optional

Signed-off-by: Anton Kovalyov <anton@kovalyov.net>