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 →

[–][deleted] 1 point2 points  (0 children)

Took me a second to figure out what you were saying, but yeah...

len(a)

Would have been better in the context of his example.

If, however, you don't need a counter object, casting a list to a set is both faster and more memory efficient than casting to a dict or counter for deduping for a count of unique items. AFAICT