Project

General

Profile

« Previous | Next » 

Revision 1881

iters.py: Added is_iterable()

View differences:

lib/iters.py
1
# Iterators
1
# Iterators and iterables
2 2

  
3
def is_iterable(value): return getattr(value, '__iter__', False)
4

  
3 5
def flatten(outer_iter):
4 6
    for iter_ in outer_iter:
5 7
        for el in iter_: yield el

Also available in: Unified diff