aboutsummaryrefslogtreecommitdiff
path: root/mammoth/lists.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-03-14 18:25:35 +0000
committerMichael Williamson <mike@zwobble.org>2016-03-14 20:09:13 +0000
commit8f3486e5fc69f2402476b830d21b271a93ed0046 (patch)
tree615283d2b5670bf7e13ff53e05d71f43c4722b39 /mammoth/lists.py
parent6cd476e739583c4c370b47d274a87a312d9aed9e (diff)
Replace lists.collect with lists.flatten
Diffstat (limited to 'mammoth/lists.py')
-rw-r--r--mammoth/lists.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/mammoth/lists.py b/mammoth/lists.py
index e8477cb..db1f9ca 100644
--- a/mammoth/lists.py
+++ b/mammoth/lists.py
@@ -1,19 +1,10 @@
import sys
-def collect(values):
- result = []
- _collect(values, result)
- return result
+def flatten(values):
+ return flat_map(lambda x: x, values)
-def _collect(values, result):
- for value in values:
- if isinstance(value, list):
- _collect(value, result)
- elif value is not None:
- result.append(value)
-
def unique(values):
output = []
seen = set()