[ create a new paste ] login | about

Link: http://codepad.org/xKQDux9c    [ raw code | output | fork ]

Python, pasted on Aug 23:
1
2
3
4
5
6
7
8
9
10
11
def get_match():
    def match(v,cache=[]):
        if cache:
            return cache
        else:
            cache = [v]
            return cache
    return match
m = get_match()
print m(2)
print m(3)


Output:
1
2
[2]
[3]


Create a new paste based on this one


Comments: