def flatten_iterable(iterable):
for item in iterable:<EOL><INDENT>if isinstance(item, collections.Iterable) and not isinstance(item, str):<EOL><INDENT>for sub in flatten_iterable(item):<EOL><INDENT>yield sub<EOL><DEDENT><DEDENT>else:<EOL><INDENT>yield item<EOL><DEDENT><DEDENT>
flatten iterable, but leaves out strings

    [[[1, 2, 3], [4, 5]], 6] -> [1, 2, 3, 4, 5, 6]