2 ms·
I understand the context, but isn't it unfair to compare `append` and `+` ? Python is not clojure or sml, I think people assume mutability, and using foo() + [1
by agumonkey 13y ago
I understand the context, but isn't it unfair to compare `append` and `+` ? Python is not clojure or sml, I think people assume mutability, and using foo() + [1] will consistently build fresh objects in both cases.
- mattdeboard 13y agoNo, I don't think it's unfair because "fairness" has nothing to do with anything. I was simply illustrating how using a mutable data structure defined in an outer scope can bite you.
- agumonkey 13y agoFair enough. May I mention the default parameter bite too. It's hard to notice at first.