Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
72fb6fd6
Commit
72fb6fd6
authored
11 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
fhdl/tools/flat_iteration: generalize
parent
f53acb92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
migen/fhdl/tools.py
migen/fhdl/tools.py
+3
-1
No files found.
migen/fhdl/tools.py
View file @
72fb6fd6
import
collections
from
migen.fhdl.structure
import
*
from
migen.fhdl.structure
import
*
from
migen.fhdl.structure
import
_Operator
,
_Slice
,
_Assign
,
_ArrayProxy
from
migen.fhdl.structure
import
_Operator
,
_Slice
,
_Assign
,
_ArrayProxy
from
migen.fhdl.visit
import
NodeVisitor
,
NodeTransformer
from
migen.fhdl.visit
import
NodeVisitor
,
NodeTransformer
def
flat_iteration
(
l
):
def
flat_iteration
(
l
):
for
element
in
l
:
for
element
in
l
:
if
isinstance
(
element
,
(
list
,
tup
le
)
)
:
if
isinstance
(
element
,
collections
.
Iterab
le
):
for
element2
in
flat_iteration
(
element
):
for
element2
in
flat_iteration
(
element
):
yield
element2
yield
element2
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment