Itertools wishlists

Steven Bethard steven.bethard at gmail.com
Mon Mar 14 10:25:45 EST 2005


Ville Vainio wrote:
> A simpler API:
> 
> def flatten(sequence, atomic_test = lambda o: isinstance(o,basestring)):
>   """ don't recurse into iterables if atomic_test -> True """

Yes, this is also the API I would have suggested.  Simple, but flexible 
enough to handle the odd cases with the occasional user-defined iterable 
non-containers.

STeVe



More information about the Python-list mailing list