summaryrefslogtreecommitdiff
path: root/mammoth/lists.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-05-24 21:45:25 +0100
committerMichael Williamson <mike@zwobble.org>2017-05-24 21:45:25 +0100
commit6442b4ff15cbf615400c0a093af0393b2272a22c (patch)
treef55a06b21a0cc6dd320e8168263d0826bb60ce89 /mammoth/lists.py
parent838736f4d74b43d59aa7bdc96830e0be7fd7f258 (diff)
Write thead and th for headers in table
Diffstat (limited to 'mammoth/lists.py')
-rw-r--r--mammoth/lists.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mammoth/lists.py b/mammoth/lists.py
index db1f9ca..28468fe 100644
--- a/mammoth/lists.py
+++ b/mammoth/lists.py
@@ -23,6 +23,12 @@ def flat_map(func, values):
]
+def find_index(predicate, values):
+ for index, value in enumerate(values):
+ if predicate(value):
+ return index
+
+
if sys.version_info[0] == 2:
map = map
filter = filter