I adore list comprehensions, but perhaps for this reason, I generally only use them for operations so simple as to be trivially correct or incorrect without any debugging.
Dict comprehensions are just a little muddier, even for simple things, but a single line of debug output after the comprehension should confirm whether or not you're getting the structure you expect, provided you are still doing only trivial work inside your comprehension.
Comments
I adore list comprehensions, but perhaps for this reason, I generally only use them for operations so simple as to be trivially correct or incorrect without any debugging.
Dict comprehensions are just a little muddier, even for simple things, but a single line of debug output after the comprehension should confirm whether or not you're getting the structure you expect, provided you are still doing only trivial work inside your comprehension.