Hi Collin, > I was trying to cleanup list comprehensions from this: > > file_table = sorted([ file > for file in table1 > if file not in table2 ]) > > to this: > > file_table = sorted(set(table1).difference(table2)) > > because I find them easier to follow.
In my opinion, both are good ways to express the same thing. The second one is more expressive; but we all can store a 3-lines snippet of code in our short-term memory. The interesting question here is: is table2 a possibly long list? If yes, then can we convert it to a set, without impairing the clarity of the code? Bruno