I still think there are savings to be had by looping inside the try-except block, which avoids many setup/teardown exception handling steps. This is not so pretty in another way (repeated while on check()), but I would be interested in your timings w.r.t. your current code. def loop(self): self_pool_popleft = self.pool.popleft self_pool_append = self.pool.append self_call_exit_funcs = self.call_exit_funcs check = self.pool.__len__ while check() > 0: try: while check() > 0: task = self_pool_popleft() task.next() self_pool_append(task) except StopIteration: self_call_exit_funcs(task) -- Paul
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4