Multi thread reading a file

Paul Rubin http
Thu Jul 2 22:20:03 EDT 2009


ryles <rylesny at gmail.com> writes:
> >>> # Oh... yeah. I really *did* want 'is None' and not '== None'
> >>> which iter() will do. Sorry guys!
> 
> Please don't let this happen to you too ;)

None is a perfectly good value to put onto a queue.  I prefer
using a unique sentinel to mark the end of the stream:

   sentinel = object()



More information about the Python-list mailing list