Now I remember why it was not possible to do a list comprehension. If you use a list comprehension the result will be a list of lists because the call to lookup_slice returns a list. Anyhow, I found a cleaner solution to solve this problem.