a = b = 1 just syntactic sugar?

Steven Taschuk staschuk at telusplanet.net
Sat Jun 7 20:37:19 EDT 2003


Quoth Ed Avis:
  [...]
> A conditional operator would be nice, but contravene the important
> rule that statements (if, return, etc) can skip over blocks of code
> and control what is evaluated, while expressions cannot.  [...]

The existing logical operators short-circuit:

    >>> 0 and 1/0
    0
    >>> 1 or 1/0
    1

So short-circuiting would not be unprecedented.

-- 
Steven Taschuk                                     staschuk at telusplanet.net
Receive them ignorant; dispatch them confused.  (Weschler's Teaching Motto)





More information about the Python-list mailing list