class Test(object):

    def __init__(self, val):
        self.val = val

def __sub__(self, y):
    return Test(self.val - y.val)
x = Test(10) - Test(5)
print(x.val)
performing set operations on custom classes in python