From 6442b4ff15cbf615400c0a093af0393b2272a22c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 24 May 2017 21:45:25 +0100 Subject: Write thead and th for headers in table --- mammoth/lists.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mammoth/lists.py') 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 -- cgit v1.2.3