3 ms·
As long as you know python is doing little to no computational work.
by easytiger 4y ago
As long as you know python is doing little to no computational work.
- necovek 4y agoThat's a known and widely publicised trait of Python. In the early days, Python tutorial warned against adding to strings by doing "+" even though it works because that performed a new allocation and string copy. What you were asked to do was use fast, optimized C-based primitives like "\n".join(list_of_strings) etc. Basically, Python is an "ergonomic" language built in C. Saying how something is implemented in C at the lower level is pointless, because all of Python is. Yes, doing loops over large data sets in Python is slow. Which is why it provides itertools (again, C-based functions) in stdlib.