Recursive flatten with lazy evaluation iterator
Not my idea, but I think this is better:

import collections


def flatten(lst):
    for item in lst:
        if isinstance(item, collections.Iterable) and not isinstance(item, basestring):
            for sublst in flatten(item):
                yield sublst
        else:
            yield item