
July 27, 2000
4:09 p.m.
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/