manage levels for 'multiple included lists' (#46359)
* manage levels for 'multiple included lists' fixes #46343
This commit is contained in:
parent
878599fd9f
commit
80d977bac6
1 changed files with 2 additions and 2 deletions
|
@ -440,8 +440,8 @@ def flatten(mylist, levels=None):
|
|||
if levels is None:
|
||||
ret.extend(flatten(element))
|
||||
elif levels >= 1:
|
||||
levels = int(levels) - 1
|
||||
ret.extend(flatten(element, levels=levels))
|
||||
# decrement as we go down the stack
|
||||
ret.extend(flatten(element, levels=(int(levels) - 1)))
|
||||
else:
|
||||
ret.append(element)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue