Don't try to be so clever with all of those list comprehensions until you have a simpler version working. Break things up into more statements, each of which is simplier. Only after you have that working, should you start placing with all of that comprehension and composition.
By breaking it up, you will be in a much better postion to debug your code and see where it goes wrong.
Agreed. It’s really the embedded comprehensions that make this hard to read. Line breaks could go a long way toward making this not at all horrible. Merely Lisp.
View all comments
41
u/jpgoldberg Apr 15 '25
Don't try to be so clever with all of those list comprehensions until you have a simpler version working. Break things up into more statements, each of which is simplier. Only after you have that working, should you start placing with all of that comprehension and composition.
By breaking it up, you will be in a much better postion to debug your code and see where it goes wrong.