Mar-23-2017, 08:46 PM
When something doesn't work, and you don't know why, and you don't know where the issue is, the first thing you should do is simplify the problem. In your case, that means getting rid of the list comprehensions, and all those excessive parentheses that make it very difficult to read. This isn't lisp, after all.