akuchling/jwzthreading — pull request #1 by my-flow (2011-11-01 22:07:04+00:00)
Title: BUGFIX: maximum recursion depth exceeded 

The Mail Trends project uses this algorithm for threading IMAP mail messages. With 8000+ messages or so the thread analysis goes on the fritz (see http://code.google.com/p/mail-trends/wiki/GettingStarted). One of the reasons is the "has_descendant" method, which calls itself too often. This patch implements DFS by iteration to solve the issue with the growing call stack.