1 or 1/0 doesn't raise an exception

Grant Edwards grante at visi.com
Sun Dec 14 10:37:25 EST 2008


On 2008-12-14, Daniel Fetchinson <fetchinson at googlemail.com> wrote:

> Let me just point out that unsuspecting people (like me) might rely on
> the whole expression to be evaluated and rely on exceptions being
> raised if needed.

Short circuit evaluation of booleans is very common (and has
been for decades), so I don't know why people would expect
something else.

-- 
Grant




More information about the Python-list mailing list