249
If you need to know before you use the generator, then no, there is no simple way. If you can wait until after you have used the generator, there is a simple way:
was_empty = True
for some_item in some_generator:
was_empty = False
do_something_with(some_item)
if was_empty:
handle_already_empty_generator_case()