{"id":85,"date":"2026-05-19T11:50:14","date_gmt":"2026-05-19T03:50:14","guid":{"rendered":"https:\/\/www.devfm.cn\/?p=85"},"modified":"2026-05-19T11:50:14","modified_gmt":"2026-05-19T03:50:14","slug":"wrapper","status":"publish","type":"post","link":"https:\/\/www.devfm.cn\/?p=85","title":{"rendered":"wrapper"},"content":{"rendered":"<pre><code class=\"language-python line-numbers\">\"\"\"Module providing a function printing python version.\"\"\"\n\n\ndef wrapper(fn):\n    \"\"\"Function printing python version.\"\"\"\n    def inner(*args, **kwargs):\n        print('wrapper start')\n        ret = fn(*args, **kwargs)\n        print('wrapper end')\n        return ret\n    return inner\n\ndef wrapper1(fn):\n    \"\"\"Function printing python version.\"\"\"\n    def inner(*args, **kwargs):\n        print('wrapper1 start')\n        ret = fn(*args, **kwargs)\n        print('wrapper1 end')\n        return ret\n    return inner\n\n@wrapper1\n@wrapper\ndef show(name):\n    \"\"\"Function printing python version.\"\"\"\n    print(f\"show: {name}\")\n    return {name: name}\n\nresult = show('renho')\nprint('done: ' + str(result))\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;&#8221;&#8221;Module providing a function printing python version.&hellip; <a class=\"read-more-link\" href=\"https:\/\/www.devfm.cn\/?p=85\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=85"}],"version-history":[{"count":1,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":86,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=\/wp\/v2\/posts\/85\/revisions\/86"}],"wp:attachment":[{"href":"https:\/\/www.devfm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devfm.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}