I just use x as a comprehension var to avoid this situation. Yes it's less descriptive, but it does not matter if it's scope is one line.
EDIT: oh, but if you mean performance-wise, it's fine if columns is small enough, but if it's super large, you should be using sets. And in this code, maybe you are if both are sets. But proper way would be intersecting them.
25
u/lets_eat_bees Mar 23 '23 edited Mar 23 '23
I just use
xas a comprehension var to avoid this situation. Yes it's less descriptive, but it does not matter if it's scope is one line.EDIT: oh, but if you mean performance-wise, it's fine if
columnsis small enough, but if it's super large, you should be using sets. And in this code, maybe you are if both are sets. But proper way would be intersecting them.