This commit is contained in:
DiG 2022-01-17 15:22:43 +01:00
parent 076893cc1e
commit 18f339bc97
1 changed files with 8 additions and 8 deletions

View File

@ -54,14 +54,14 @@ eprint( MODEL_IGNORE )
def flatten(items): # def flatten(items):
"""Yield items from any nested iterable; see Reference.""" # """Yield items from any nested iterable; see Reference."""
for x in items: # for x in items:
if isinstance(x, Iterable) and not isinstance(x, (str, bytes)): # if isinstance(x, Iterable) and not isinstance(x, (str, bytes)):
for sub_x in flatten(x): # for sub_x in flatten(x):
yield sub_x # yield sub_x
else: # else:
yield x # yield x
def jlog( obj ): def jlog( obj ):