There's a great function called "walk" at that iterates over arbitrary data (and is recursion-proof) at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/118845 It also supplies a recursion-proof way to flatten a list. (Once you can iterate over an arbitrary sequence, the flattened version is just [element for element in walk(sequence)].) I use both functions all the time. Adding a flatten function (along with walk) to Python sounds like a good idea to me. Having used Mathematica for many years, which uses Flatten[] all over the place, I was actually quite surprised to find that Python didn't have it. Michael -- http://mail.python.org/mailman/listinfo/python-list