Avoiding local variable declarations?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Nov 18 02:12:25 CET 2008


En Mon, 17 Nov 2008 22:18:51 -0200, Steven D'Aprano  
<steven at remove.this.cybersource.com.au> escribió:

> On Mon, 17 Nov 2008 12:32:35 +0000, Marc 'BlackJack' Rintsch wrote:
>
>> Not such illogical crap like
>> ``a = a + 1`` which must be obviously false unless 1 is defined as the
>> neutral element for the definition of ``+`` here.
>
> I don't quite know what you mean by "neutral element". I think you mean
> the identity element under addition, which is zero, but that doesn't  
> work:
>
> 0 = 0 + 1
>
> Obviously not.

Perhaps you didn't read carefully the above post? He said "unless *1* is  
defined as the neutral element for ``+``"
Calling "1" the identity of the "+" operation, or calling "+" an operation  
having "1" as its identity element is, errr, uncommon at least, but  
perfectly valid...

-- 
Gabriel Genellina




More information about the Python-list mailing list