Hacker News new | ask | show | jobs
by automatoney 208 days 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.
2 comments

I 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... for instance. Didn't want to link the one on Amazon
Yeah, 10 felt like it was written by ai.
A lot of it felt that way, to me.