Mar-22-2017, 09:44 AM
List comprehension is more universal, as sets work only with hashable items. Sometimes one could be bitten with a fact that immutability doesnt guarantee hashability (usually with tuples - while (1, [2]) is tuple and therefore immutable, it is not hashable).