I'm using using generators and iterators more and more intead of
passing lists around, and prefer them. However, I'm not clear on the
best way to detect an empty generator (one that will return no items)
when some sort of special case handling is required.
Typical code for handling an empty list:
>
> Am I so deperately fighting the language? No-one here on the list needs to
> set hundreds
> variables at once somewhere in their code? I still don't get why:
>
I once (and only once) needed hundreds of variables in a program. It
was to simplify creation of unit tests, not for production us
I have a command line Python program that sometimes takes a bit
(several minutes) to run. I want to provide an optional method for an
impatient user (me!) to check the status of the program. The type and
amount of status information doesn't fit nicely into a --verbose or
logger -- either too litt