{"id":1046515,"date":"2024-12-31T13:34:07","date_gmt":"2024-12-31T05:34:07","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1046515.html"},"modified":"2024-12-31T13:34:11","modified_gmt":"2024-12-31T05:34:11","slug":"python%e7%a8%8b%e5%ba%8f%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8%e5%8a%a8%e6%80%81%e5%87%bd%e6%95%b0%e5%90%97","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1046515.html","title":{"rendered":"python\u7a0b\u5e8f\u5982\u4f55\u8c03\u7528\u52a8\u6001\u51fd\u6570\u5417"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/8d93edc7-fe5a-4e41-af49-4e7d17498fd3.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"python\u7a0b\u5e8f\u5982\u4f55\u8c03\u7528\u52a8\u6001\u51fd\u6570\u5417\" \/><\/p>\n<p><p> <strong>Python\u7a0b\u5e8f\u8c03\u7528\u52a8\u6001\u51fd\u6570\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528<code>eval<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>exec<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>globals()<\/code>\u548c<code>locals()<\/code>\u51fd\u6570\u3002<\/strong> \u5176\u4e2d\uff0c\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570\u662f\u4e00\u79cd\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u6cd5\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570\u6765\u52a8\u6001\u8c03\u7528\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><p><code>getattr<\/code>\u51fd\u6570\u662fPython\u4e2d\u7528\u4e8e\u83b7\u53d6\u5bf9\u8c61\u5c5e\u6027\u7684\u65b9\u6cd5\uff0c\u901a\u8fc7\u8fd9\u4e2a\u51fd\u6570\u53ef\u4ee5\u52a8\u6001\u5730\u83b7\u53d6\u548c\u8c03\u7528\u5bf9\u8c61\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u7c7b<code>MyClass<\/code>\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u591a\u4e2a\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570\u6765\u52a8\u6001\u8c03\u7528\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def method1(self):<\/p>\n<p>        print(&quot;Method 1 called&quot;)<\/p>\n<p>    def method2(self):<\/p>\n<p>        print(&quot;Method 2 called&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b<\/strong><\/h2>\n<p>my_instance = MyClass()<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528method1<\/strong><\/h2>\n<p>method_name = &quot;method1&quot;<\/p>\n<p>method = getattr(my_instance, method_name)<\/p>\n<p>method()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>getattr(my_instance, method_name)<\/code>\u6765\u52a8\u6001\u83b7\u53d6<code>my_instance<\/code>\u5bf9\u8c61\u7684<code>method1<\/code>\u65b9\u6cd5\uff0c\u5e76\u8c03\u7528\u5b83\u3002\u8fd9\u79cd\u65b9\u5f0f\u4e0d\u4ec5\u7b80\u6d01\uff0c\u800c\u4e14\u907f\u514d\u4e86\u4f7f\u7528<code>eval<\/code>\u548c<code>exec<\/code>\u51fd\u6570\u5e26\u6765\u7684\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528<code>eval<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>eval<\/code>\u51fd\u6570\u53ef\u4ee5\u5c06\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u8868\u8fbe\u5f0f\u8f6c\u6362\u4e3a\u5b9e\u9645\u7684Python\u8868\u8fbe\u5f0f\u5e76\u6267\u884c\u3002\u867d\u7136<code>eval<\/code>\u51fd\u6570\u5728\u4e00\u4e9b\u60c5\u51b5\u4e0b\u975e\u5e38\u5f3a\u5927\uff0c\u4f46\u5b83\u4e5f\u5e26\u6765\u4e86\u5b89\u5168\u9690\u60a3\uff0c\u56e0\u4e3a\u5b83\u4f1a\u6267\u884c\u4f20\u5165\u7684\u5b57\u7b26\u4e32\uff0c\u5bb9\u6613\u53d7\u5230\u4ee3\u7801\u6ce8\u5165\u653b\u51fb\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def dynamic_function():<\/p>\n<p>    print(&quot;Dynamic function called&quot;)<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528<\/strong><\/h2>\n<p>eval(&quot;dynamic_function()&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>eval<\/code>\u51fd\u6570\u5c06\u5b57\u7b26\u4e32<code>&quot;dynamic_function()&quot;<\/code>\u8f6c\u6362\u4e3a\u5b9e\u9645\u7684\u51fd\u6570\u8c03\u7528\u5e76\u6267\u884c\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>exec<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>exec<\/code>\u51fd\u6570\u7528\u4e8e\u6267\u884c\u52a8\u6001\u751f\u6210\u7684Python\u4ee3\u7801\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u7075\u6d3b\uff0c\u4f46\u4e5f\u6709\u7c7b\u4f3c<code>eval<\/code>\u51fd\u6570\u7684\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def dynamic_function():<\/p>\n<p>    print(&quot;Dynamic function called&quot;)<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528<\/strong><\/h2>\n<p>exec(&quot;dynamic_function()&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>exec<\/code>\u51fd\u6570\u4f1a\u6267\u884c\u4f20\u5165\u7684\u5b57\u7b26\u4e32\u4ee3\u7801\uff0c\u8fd9\u610f\u5473\u7740\u5982\u679c\u4ee3\u7801\u4e2d\u5305\u542b\u6076\u610f\u6307\u4ee4\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5982\u524d\u6240\u8ff0\uff0c<code>getattr<\/code>\u51fd\u6570\u662f\u4e00\u79cd\u66f4\u4e3a\u5b89\u5168\u548c\u5e38\u89c1\u7684\u52a8\u6001\u8c03\u7528\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u66f4\u4e3a\u8be6\u7ec6\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def method1(self):<\/p>\n<p>        print(&quot;Method 1 called&quot;)<\/p>\n<p>    def method2(self):<\/p>\n<p>        print(&quot;Method 2 called&quot;)<\/p>\n<p>def call_method(instance, method_name):<\/p>\n<p>    try:<\/p>\n<p>        method = getattr(instance, method_name)<\/p>\n<p>        method()<\/p>\n<p>    except AttributeError:<\/p>\n<p>        print(f&quot;Method {method_name} not found&quot;)<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u5b9e\u4f8b<\/strong><\/h2>\n<p>my_instance = MyClass()<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528method1\u548cmethod2<\/strong><\/h2>\n<p>call_method(my_instance, &quot;method1&quot;)<\/p>\n<p>call_method(my_instance, &quot;method2&quot;)<\/p>\n<p>call_method(my_instance, &quot;method3&quot;)  # \u4e0d\u5b58\u5728\u7684\u65b9\u6cd5<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>call_method<\/code>\u51fd\u6570\u63a5\u53d7\u4e00\u4e2a\u5b9e\u4f8b\u548c\u65b9\u6cd5\u540d\uff0c\u4f7f\u7528<code>getattr<\/code>\u51fd\u6570\u6765\u52a8\u6001\u8c03\u7528\u65b9\u6cd5\uff0c\u5e76\u5904\u7406\u53ef\u80fd\u7684<code>AttributeError<\/code>\u5f02\u5e38\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528<code>globals()<\/code>\u548c<code>locals()<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p><code>globals()<\/code>\u548c<code>locals()<\/code>\u51fd\u6570\u8fd4\u56de\u5f53\u524d\u5168\u5c40\u548c\u5c40\u90e8\u547d\u540d\u7a7a\u95f4\u7684\u5b57\u5178\uff0c\u5206\u522b\u53ef\u4ee5\u7528\u4e8e\u52a8\u6001\u8c03\u7528\u5168\u5c40\u548c\u5c40\u90e8\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def global_function():<\/p>\n<p>    print(&quot;Global function called&quot;)<\/p>\n<p>def call_global_function(function_name):<\/p>\n<p>    globals()[function_name]()<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528<\/strong><\/h2>\n<p>call_global_function(&quot;global_function&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>globals()[function_name]<\/code>\u7528\u4e8e\u52a8\u6001\u8c03\u7528\u5168\u5c40\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u7ed3\u5408\u51fd\u6570\u6620\u5c04\u8868\u8fdb\u884c\u52a8\u6001\u8c03\u7528<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u66f4\u597d\u5730\u7ba1\u7406\u51fd\u6570\u8c03\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u51fd\u6570\u6620\u5c04\u8868\uff0c\u5c06\u51fd\u6570\u540d\u4e0e\u51fd\u6570\u5bf9\u8c61\u8fdb\u884c\u6620\u5c04\uff0c\u4fbf\u4e8e\u52a8\u6001\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">def function1():<\/p>\n<p>    print(&quot;Function 1 called&quot;)<\/p>\n<p>def function2():<\/p>\n<p>    print(&quot;Function 2 called&quot;)<\/p>\n<p>functions = {<\/p>\n<p>    &quot;function1&quot;: function1,<\/p>\n<p>    &quot;function2&quot;: function2<\/p>\n<p>}<\/p>\n<p>def call_function(function_name):<\/p>\n<p>    try:<\/p>\n<p>        functions[function_name]()<\/p>\n<p>    except KeyError:<\/p>\n<p>        print(f&quot;Function {function_name} not found&quot;)<\/p>\n<h2><strong>\u52a8\u6001\u8c03\u7528<\/strong><\/h2>\n<p>call_function(&quot;function1&quot;)<\/p>\n<p>call_function(&quot;function2&quot;)<\/p>\n<p>call_function(&quot;function3&quot;)  # \u4e0d\u5b58\u5728\u7684\u51fd\u6570<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>functions<\/code>\u5b57\u5178\u5c06\u51fd\u6570\u540d\u6620\u5c04\u5230\u51fd\u6570\u5bf9\u8c61\uff0c<code>call_function<\/code>\u51fd\u6570\u6839\u636e\u4f20\u5165\u7684\u51fd\u6570\u540d\u4ece\u5b57\u5178\u4e2d\u67e5\u627e\u5e76\u8c03\u7528\u5bf9\u5e94\u7684\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u52a8\u6001\u521b\u5efa\u548c\u8c03\u7528\u7c7b\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u52a8\u6001\u8c03\u7528\u5df2\u6709\u65b9\u6cd5\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u52a8\u6001\u521b\u5efa\u548c\u8c03\u7528\u7c7b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    pass<\/p>\n<p>def dynamic_method(self):<\/p>\n<p>    print(&quot;Dynamic method called&quot;)<\/p>\n<h2><strong>\u52a8\u6001\u6dfb\u52a0\u65b9\u6cd5<\/strong><\/h2>\n<p>MyClass.dynamic_method = dynamic_method<\/p>\n<h2><strong>\u521b\u5efa\u5b9e\u4f8b\u5e76\u8c03\u7528\u52a8\u6001\u65b9\u6cd5<\/strong><\/h2>\n<p>my_instance = MyClass()<\/p>\n<p>my_instance.dynamic_method()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u8ff0\u4ee3\u7801\u4e2d\uff0c<code>dynamic_method<\/code>\u51fd\u6570\u88ab\u52a8\u6001\u6dfb\u52a0\u5230<code>MyClass<\/code>\u7c7b\u4e2d\uff0c\u5e76\u901a\u8fc7\u5b9e\u4f8b\u8fdb\u884c\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u7a0b\u5e8f\u8c03\u7528\u52a8\u6001\u51fd\u6570\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528<code>eval<\/code>\u51fd\u6570\u3001<code>exec<\/code>\u51fd\u6570\u3001<code>getattr<\/code>\u51fd\u6570\u3001<code>globals()<\/code>\u548c<code>locals()<\/code>\u51fd\u6570\u3002<strong>\u5176\u4e2d\uff0c<code>getattr<\/code>\u51fd\u6570\u662f\u4e00\u79cd\u6700\u5e38\u89c1\u4e14\u5b89\u5168\u7684\u65b9\u6cd5\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u573a\u666f\u3002<\/strong> \u901a\u8fc7\u7ed3\u5408\u51fd\u6570\u6620\u5c04\u8868\uff0c\u6211\u4eec\u53ef\u4ee5\u66f4\u52a0\u9ad8\u6548\u548c\u7075\u6d3b\u5730\u7ba1\u7406\u548c\u8c03\u7528\u51fd\u6570\u3002\u6b64\u5916\uff0c\u6211\u4eec\u8fd8\u53ef\u4ee5\u52a8\u6001\u521b\u5efa\u548c\u8c03\u7528\u7c7b\u65b9\u6cd5\uff0c\u8fdb\u4e00\u6b65\u63d0\u9ad8\u4ee3\u7801\u7684\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u52a8\u6001\u51fd\u6570\u5728Python\u4e2d\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u52a8\u6001\u51fd\u6570\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528<code>eval()<\/code>\u3001<code>exec()<\/code>\u6216\u8005\u901a\u8fc7\u51fd\u6570\u5bf9\u8c61\u7684\u5c5e\u6027\u6765\u5b9e\u73b0\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u51fd\u6570\u540d\u5b58\u50a8\u4e3a\u5b57\u7b26\u4e32\uff0c\u4e4b\u540e\u901a\u8fc7<code>globals()<\/code>\u6216<code>locals()<\/code>\u5b57\u5178\u6765\u8c03\u7528\u8fd9\u4e9b\u51fd\u6570\u3002\u52a8\u6001\u8c03\u7528\u4f7f\u5f97\u7a0b\u5e8f\u80fd\u591f\u6839\u636e\u8fd0\u884c\u65f6\u7684\u4fe1\u606f\u6765\u51b3\u5b9a\u6267\u884c\u54ea\u4e2a\u51fd\u6570\uff0c\u589e\u52a0\u4e86\u7075\u6d3b\u6027\u548c\u53ef\u6269\u5c55\u6027\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u4f7f\u7528lambda\u8868\u8fbe\u5f0f\u52a8\u6001\u521b\u5efa\u51fd\u6570\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>lambda<\/code>\u8868\u8fbe\u5f0f\u6765\u52a8\u6001\u521b\u5efa\u5c0f\u578b\u533f\u540d\u51fd\u6570\u3002\u8fd9\u79cd\u65b9\u5f0f\u9002\u5408\u4e8e\u9700\u8981\u5feb\u901f\u5b9a\u4e49\u51fd\u6570\u7684\u573a\u666f\uff0c\u6bd4\u5982\u5728\u6392\u5e8f\u6216\u8fc7\u6ee4\u5217\u8868\u65f6\u3002\u901a\u8fc7\u5c06\u8868\u8fbe\u5f0f\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f60\u53ef\u4ee5\u968f\u65f6\u8c03\u7528\u8fd9\u4e2a\u52a8\u6001\u521b\u5efa\u7684\u51fd\u6570\u3002<\/p>\n<p><strong>Python\u4e2d\u5982\u4f55\u5904\u7406\u51fd\u6570\u7684\u53c2\u6570\u52a8\u6001\u4f20\u9012\uff1f<\/strong><br \/>Python\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u65b9\u5f0f\u6765\u5904\u7406\u51fd\u6570\u7684\u53c2\u6570\u52a8\u6001\u4f20\u9012\u3002\u53ef\u4ee5\u4f7f\u7528<code>*args<\/code>\u548c<code>**kwargs<\/code>\u6765\u63a5\u6536\u53ef\u53d8\u6570\u91cf\u7684\u4f4d\u7f6e\u53c2\u6570\u548c\u5173\u952e\u5b57\u53c2\u6570\u3002\u8fd9\u6837\uff0c\u60a8\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u6839\u636e\u5b9e\u9645\u9700\u8981\u51b3\u5b9a\u4f20\u9012\u54ea\u4e9b\u53c2\u6570\uff0c\u4ece\u800c\u5b9e\u73b0\u66f4\u9ad8\u7684\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u7a0b\u5e8f\u8c03\u7528\u52a8\u6001\u51fd\u6570\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528eval\u51fd\u6570\u3001\u4f7f\u7528exec\u51fd\u6570\u3001\u4f7f\u7528getattr\u51fd\u6570\u3001\u4f7f\u7528glob [&hellip;]","protected":false},"author":3,"featured_media":1046536,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1046515"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1046515"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1046515\/revisions"}],"predecessor-version":[{"id":1046538,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1046515\/revisions\/1046538"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1046536"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1046515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1046515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1046515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}