I want to implement a test t() that will return True if its two
arguments are "completely" different. By this I mean that they
don't share any "non-atomic" component. E.g., if
a = [0, 1]
b = [0, 1]
c = [2, 3]
d = [2, 3]
A = (a, c, 0)
B = (a, d, 1)
C = (b, d, 0)
The desired test t() would yield:
t(A, B) -> False (A and B share the mutable component a)
t(A, C) -> True (a =!= c, b =!= d, and 0 is not mutable)
t(B, C) -> False (B and C share the mutable component d)
(=!= is shorthand with "is not identical to".)
It would facilitate the implementation of t() to have a simple test
for mutability. Is there one?
Thanks!
~kj
--
http://mail.python.org/mailman/listinfo/python-list