Hacker News new | ask | show | jobs
by dagw 2691 days ago
Except that won't return a list. You need list(set(<list>)). Also using set means you lose list ordering, which isn't the case when using dict (assuming python 3.6 or higher).

That being said, and not that it should ever make a difference, list(set(<list>)) is 2-3 times faster than list(dict.fromkeys(<list>))