Waffling (was Re: single-line terinary operators considered harmful)

Steven Taschuk staschuk at telusplanet.net
Thu Mar 6 21:03:50 CET 2003

Quoth Stephen Horne:
> I tend to dislike '++' in C more than perhaps I should (and more than
> the 'next' function above) because the C standard does not guarentee
> when the postincrement is done [...]

An excellent point.  (And one I have been bitten by.)

> That doesn't happen with a function, and can't happen at all in
> Python.

Certainly Python's guaranteed evaluation and execution order is
very comfortable.  There is the occasional oddity:
	d = {}
	i = 3
	i = d[i] = i+1
has a surprising (to me) result.  But this isn't good style anyway.

Steven Taschuk                            staschuk at telusplanet.net
Every public frenzy produces legislation purporting to address it.
                                           (Kinsley's Law)

More information about the Python-list mailing list