A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-July/007515.html below:

[Python-Dev] PEP 203 Augmented Assignment

[Python-Dev] PEP 203 Augmented Assignment [Python-Dev] PEP 203 Augmented AssignmentM.-A. Lemburg mal@lemburg.com
Thu, 27 Jul 2000 18:09:05 +0200
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