On 20/09/2011 20:09, Zero Piraeus wrote:
:

On 20 September 2011 14:42, MRAB<pyt...@mrabarnett.plus.com>  wrote:
On 20/09/2011 19:13, Kayode Odeyemi wrote:

     if item is not {} and timeout is not 0:

`not {}` has the value True, so `item is not {}` means `item is True`.
The `is` checks for identity, not equality, so this is true only if `item`
actually has the value True or 1 (and this is an implementation-dependent
behaviour).

Nitpick: "is not" is an operator:

"foo" is not {}
True
"foo" is (not {})
False

Oops! True.

However, it still doesn't do what the OP intended:

>>> {} is {}
False
>>> {} is not {}
True
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to