First page Back Continue Last page Overview Graphics

Simple “Call Once” Decorator

def register(function):

print “LOOK! “, function.__name__

return function

@register

def print_hello():

print “Hello”

print_hello()

print_hello()