How to decorate a method inside a class?

Python automatically passes the class instance as reference. (The self argument which is seen in all class methods).

You could do:

def formatHeader(fn):
    def wrapped(self=None):
        return '<div class="page_header">'+fn(self)+'</div>'
    return wrapped