1 or 1/0 doesn't raise an exception

Wojciech Muła wojciech_mula at poczta.null.onet.pl.invalid
Sat Dec 13 21:14:37 EST 2008


"Daniel Fetchinson" <fetchinson at googlemail.com> wrote:

> Is it a feature that
> 
> 1 or 1/0
> 
> returns 1 and doesn't raise a ZeroDivisionError? If so, what's the rationale?

See: http://en.wikipedia.org/wiki/Short-circuit_evaluation



More information about the Python-list mailing list