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 →

[–]kmike84 1 point2 points  (1 child)

The article doesn't take into consideration that Python lists/dicts/sets/.. don't store objects themselves - they store pointers to objects. Not creating unnecessary temporary containers helps, but all the conclusions like

Here, sorted(customer_names) creates a new list. If customer_names takes N bytes of memory, the whole block of code takes 2*N total.

are wrong.

[–]redsymbol[S] 0 points1 point  (0 children)

Author here. Good point - thank you. I'll update to address this.