-
-
Save jianghu52/04f6144f897e9326f3a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def decorator_whith_params_and_func_args(arg_of_decorator): | |
def handle_func(func): | |
print "start handle" | |
def warp(): | |
print "start warp" | |
func() | |
print "end warp" | |
print "end handle" | |
return warp | |
return handle_func | |
@decorator_whith_params_and_func_args("123") | |
def foo4(): | |
print "Content" | |
foo4() | |
#输出结果为 | |
#start handle | |
#end handle | |
#start warp | |
#Content | |
#end warp | |
#而不是我希望的 | |
#start handle | |
#start warp | |
#Content | |
#end warp | |
#end handle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment