Closed cclauss closed 5 years ago
A simple fix would be to remove the parens around (index, value) but that works sometimes and not others
This won't work certainly because the argument of lambda is a tuple which is deconstructed here. This is no longer possible in Python 3; I suppose the easiest solution is to say lambda x: keep_indices[x[0]], enumerate(x[1])
.
There are no tests for any of this code, this is just a set of data collection scripts for bench testing.
I will rework it as a list comprehension.
Fixed by removal in #41
At least one Python 3 syntax error remains...
Is there a test case around this code?
A simple fix would be to remove the parens around (index, value) but that works sometimes and not others so a strong test case is needed. In general, modern Python used list comprehensions instead of filter() and map() especially when used with lambdas.
https://docs.python.org/3/whatsnew/3.0.html#views-and-iterators-instead-of-lists