Is it really good?
Nadav Horesh
NadavH at envision.co.il
Tue Jan 7 04:12:47 EST 2003
Can someone explain why python does not raise NameError in the first
test line blow.
I get similar results with Python 2.3a1, wich (obviously) answer False
instead of 0.
===============================================================
Python 2.2.2 (#5, Dec 19 2002, 10:39:16)
[GCC 3.2.1] on linux2
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>> 2 == 3 is good
0 # ????????????????????????
>>> (2 == 3) is good
Traceback (most recent call last):
File "<pyshell#1>", line 1, in ?
(2 == 3) is good
NameError: name 'good' is not defined
>>> 2 == (3 is good)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in ?
2 == (3 is good)
NameError: name 'good' is not defined
>>>
===============================================================
Nadav.
More information about the Python-list
mailing list