class Infix(object):
    """
    Instances of this class can be treated like an infix operator
    by enclosing them with <<.>>.
    """

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

def __rlshift__(self, other):
    return Infix(lambda x, self=self, other=other: self.function(other, x))

def __rshift__(self, other):
    return self.function(other)

def __call__(self, value1, value2):
    return self.function(value1, value2)
Как добавить макрос для чтения в Python?