Jay Loden wrote: > Dick Moores wrote: >> >>> () is () >> True >> >>> (1,) is (1,) >> False >> >> Why? >> >> Thanks, >> >> Dick Moores >
>From the docs for 'is': The operators is and is not test for object identity: x is y is true if and only if x and y are the same object. x is not y yields the inverse truth value. So you're actually testing whether or not the identity of the object is the same, not whether (1,) == (1,): >>> (1,) == (1,) True >>> id((0,)) == id((0,)) False -Jay -- http://mail.python.org/mailman/listinfo/python-list