#!/usr/bin/python# encoding:utf-8def one(func): print('----1----') def two(): print('----2----') func() return twodef a(func): print('----a----') def b(): print('----b----') func() return b@one@adef demo(): print('----3----')demo()
输出:
----a----
----1---- ----2---- ----b---- ----3----