Avoiding local variable declarations?

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Mon Nov 17 19:18:51 EST 2008


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.

I think the only workable answer might be a = infinity, but that has two 
problems: (1) infinity isn't a valid integer or real number (although 
there is a valid float representing infinity on many platforms); and (2) 
which infinity? Aleph 0, aleph 1, c, ... There's an infinite number of 
them.



-- 
Steven



More information about the Python-list mailing list