Paul McGuire wrote:
Considering how often this comes up, might there be a place for some sort of
flatten() routine in the std dist, perhaps itertools?

A problem I see is that itertools tries to work across all iterable types, but flattening can't always be a generalized operation. For instance, a naive flattening function might turn the list ['foo', 'bar'] into ['f', 'o', 'o', 'b', 'a', 'r'] -- or worse, fall into infinite recursion -- when the intended result would be to leave the list unchanged. Of course, a generalized flattening function could take an argument listing types to ignore, but that can get very complicated very fast.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to