[Python-ideas] Membership of infinite iterators

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 19 00:53:36 EDT 2017


Nick Coghlan wrote:
> having checks in both the producer & the consumer merely means that 
> you'll be checking for signals twice every 65k iterations, rather than once.

Here's a possible reason for wanting checks in the producers:
If your producer happens to take a long time per iteration,
and the consumer only checks every 65k iterations, it might be
a while before a Ctrl-C takes effect.

If the producer is checking, it is likely to have a better
idea of what an appropriate checking interval might be.

-- 
Greg


More information about the Python-ideas mailing list