From: Sebastien Bourdeauducq Date: Sat, 9 Mar 2013 22:03:15 +0000 (+0100) Subject: fhdl/tools/flat_iteration: generalize X-Git-Tag: 24jan2021_ls180~2099^2~671 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72fb6fd6bd6707a5044b0c7f723aedfef87b66df;p=litex.git fhdl/tools/flat_iteration: generalize --- diff --git a/migen/fhdl/tools.py b/migen/fhdl/tools.py index f9cb67c7..f7b50fd7 100644 --- a/migen/fhdl/tools.py +++ b/migen/fhdl/tools.py @@ -1,10 +1,12 @@ +import collections + from migen.fhdl.structure import * from migen.fhdl.structure import _Operator, _Slice, _Assign, _ArrayProxy from migen.fhdl.visit import NodeVisitor, NodeTransformer def flat_iteration(l): for element in l: - if isinstance(element, (list, tuple)): + if isinstance(element, collections.Iterable): for element2 in flat_iteration(element): yield element2 else: