class memoize(dict):
    def __init__(self, func):
        self.func = func

    def __call__(self, *args):
        return self[args]

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result

@memoize
def foo(a, b):
    return a * b

# foo(2, 4)
print(foo(2, 4))
print(foo)

6bfff4254afbae4881a28743db796277578c4e77
class memoize(dict):

    def __init__(self, func):
        self.func = func
    <mask token>

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result


<mask token>

class memoize(dict):

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

    def __call__(self, *args):
        return self[args]

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result


<mask token>

class memoize(dict):

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

    def __call__(self, *args):
        return self[args]

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result


@memoize
def foo(a, b):
    return a * b


<mask token>

class memoize(dict):

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

    def __call__(self, *args):
        return self[args]

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result


@memoize
def foo(a, b):
    return a * b


print(foo(2, 4))
print(foo)

class memoize(dict):
    def __init__(self, func):
        self.func = func

    def __call__(self, *args):
        return self[args]

    def __missing__(self, key):
        result = self[key] = self.func(*key)
        return result

@memoize
def foo(a, b):
    return a * b

# foo(2, 4)
print(foo(2, 4))
print(foo)
