equal
deleted
inserted
replaced
15 def _flatten(thing): |
15 def _flatten(thing): |
16 '''yield a single stream from a possibly nested set of iterators''' |
16 '''yield a single stream from a possibly nested set of iterators''' |
17 if isinstance(thing, str): |
17 if isinstance(thing, str): |
18 yield thing |
18 yield thing |
19 elif not hasattr(thing, '__iter__'): |
19 elif not hasattr(thing, '__iter__'): |
20 if i is not None: |
20 if thing is not None: |
21 yield str(thing) |
21 yield str(thing) |
22 else: |
22 else: |
23 for i in thing: |
23 for i in thing: |
24 if isinstance(i, str): |
24 if isinstance(i, str): |
25 yield i |
25 yield i |