1 or 1/0 doesn't raise an exception

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sun Dec 14 17:29:40 CET 2008


Grant Edwards a écrit :
> 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.
> 
Because they either have no previous programming experience, or only 
experience with one of the few languages that don't do short-circuit 
evaluation ?

<OP>
You can consider that short-circuit is the norm and it's absence the 
exception.
</OP>



More information about the Python-list mailing list