From this answer I have a flattened list.
Now I want to remove duplicates and sort the list. I currently have the following:
x = itertools.chain.from_iterable(results[env].values())
y = sorted(list(set(x)), key=lambda s:s.lower())
Is there a better way to do this? In my case, x has a size of ~ 32,000, and y ends with a size of ~ 1,100. I have work, but I would like to see if there is anything better (faster, more readable, etc.)
Mitch source
share