Skip Montanaro wrote: > > > >> Another important reason is that in cases like > >> > >> a[long_and_expensive_call()] = a[long_and_expensive_call()] + 1 > > M-A> Dito for this one: > > M-A> i = long_and_expensive_call() > M-A> a[i] = a[i] + 1 > > Only if you know that long_and_expensive_call() has no side effects! If it does, then you'll have to write the long version anyway, if it doesn't I don't see a problem, if you don't know then you shouldn't use the function anyway ;-)) -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4