Comment by Too
3 years ago
Can be optimized by assigning plusone = libplus.plusone, before using it as plusone(i).
Otherwise it will do an attribute lookup in each loop iteration, Python has no way to assume zero side-effects of function calls, in case lib.plusone was overwritten to something new inside the plusone function.
No comments yet
Contribute on Hacker News ↗