3 ms·
There's some genuinely interesting tips in here, but #10 is for sure just padding so they could call the article "10 Hacks" haha. Everything else is at least so
by automatoney 1y ago
There's some genuinely interesting tips in here, but #10 is for sure just padding so they could call the article "10 Hacks" haha. Everything else is at least somewhat Python specific, but "Hack 10: Avoid repeated function calls in loops" is just applicable to anything.
- knowitnone3 1y agoI agree. I can't imagine anybody would call a function that returns the same result in a loop like that. There are plenty more optimizations they could come up with. In fact, there are a couple of books https://www.oreilly.com/library/view/high-performance-python/9781492055013/ https://www.oreilly.com/library/view/high-performance-python... for instance. Didn't want to link the one on Amazon
- FuckButtons 1y agoYeah, 10 felt like it was written by ai.
- zahlman 1y agoA lot of it felt that way, to me.