Sylvain Thenault wrote:
Hi there !
Can someone explain me the following behaviour ?
l = []
0 in (l is False)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: iterable argument required
(0 in l) is False
True
0 in l is False
False
This is really obscur to me...
A suggestion:
When discussing things on the newsgroup (and in your code), avoid
symbols like "l" and "O" -- they look too much like numbers. Picking
an actual name is best (but depends on your application context).
Second best are names like: "lst", "obj", ...: often, however, such
names are necessary when discussing abstract code properties.
-Scott
--
http://mail.python.org/mailman/listinfo/python-list