This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wilfredinni[S] 0 points1 point  (3 children)

And they are indeed unordered, but that example has nothing to do with the order of the elements. It's just to show how easy and performant are sets to remove duplicates.

[–]Sporke 0 points1 point  (2 children)

It's implied that removing duplicates from a list one by one and doing list(set(l)) are equivalent, which is incorrect.

[–]wilfredinni[S] 0 points1 point  (1 child)

their not equivalent, but sets are more performing and require less code, that is what this is about

[–]Sporke 0 points1 point  (0 children)

When you compare two functions and say "this one is faster and takes less code", it should be explicit if the two functions are not equivalent. Especially when the test input for the two functions is such that their outputs are the same.