4 ms·
I see about a 10% performance improvement on my local machine on the input in test.py when not constructing the unnecessary second list. I don't really buy tha
by min-cut 5y ago
I see about a 10% performance improvement on my local machine on the input in test.py when not constructing the unnecessary second list.
I don't really buy that it reads nicer in prose since you can just do (a + b).sort() if you want. Plus, I feel like it's important for readability to not be unnecessarily redundant. Having list(a + b) code also risks creating misconceptions about how lists can be constructed and used in Python.
- agbell 5y agoYeah, good point. I think you are right about it being incorrect. Updating...