Michael Henry <pyt...@drmikehenry.com> added the comment: David,
Your patch looks fine to me. I like putting the logic is a separate class as you've done. I looked in itertools for something to perform the job of the each_last() generator I'd had in my patch, but I didn't see anything. I like the idea of encapsulating the test logic of (index + 1 == len(sequence)) in some way, as each_last() does, rather than having the caller calculate it. If that capability exists somewhere in the Python standard library, it would be my choice to use that. If it has to be built just for this test, though, perhaps it's not worth the extra lines of code to define each_last(). Michael Henry ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11606> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com