How can you implement a custom comparator for 'in' using python
===

If i had a class like this:

    class foo(object):
        def __init__(x,y,z):
             x = x
             y = y
             z = z

In a list like this:

    list = [foo(1,2,3),foo(4,5,6),foo(7,8,9)]

How could i create a custom test for 'in' such that it checks only x and z values such that this:

    new_foo = foo(1,8,3)
    if new_foo in list:
        print True
    else:
        print False

Would print True