Is it really good?

Irmen de Jong irmen at
Wed Jan 8 01:18:23 CET 2003

Nadav Horesh wrote:
> Can someone explain why python does not raise NameError in the first 
> test line blow.

>  >>> 2 == 3 is good
> 0     # ????????????????????????

At first I thought this was perfectly correct behaviour.
Because Python uses lazy evaluation.

But this is no boolean condition, which is the place I expect
this behaviour (such as "if a==b and c==d: ....").

Why indeed is the "is good" part not evaluated?

By the way if you change it to "3==3 is good", you do get the NamingError.

More information about the Python-list mailing list