{"id":946289,"date":"2024-12-26T23:39:28","date_gmt":"2024-12-26T15:39:28","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/946289.html"},"modified":"2024-12-26T23:39:31","modified_gmt":"2024-12-26T15:39:31","slug":"python%e5%a6%82%e4%bd%95%e9%81%8d%e5%8e%86%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/946289.html","title":{"rendered":"python\u5982\u4f55\u904d\u5386\u7c7b"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25082524\/f93de732-3c1d-4686-98d5-d7312ba778b6.webp\" alt=\"python\u5982\u4f55\u904d\u5386\u7c7b\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u904d\u5386\u7c7b\u7684\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u7c7b\u7684\u5c5e\u6027\u5b57\u5178\u3001dir()\u51fd\u6570\u3001\u4ee5\u53ca\u53cd\u5c04\u6a21\u5757inspect\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u5404\u6709\u4f18\u52a3\uff0c\u5177\u4f53\u9009\u62e9\u53d6\u51b3\u4e8e\u9700\u6c42\u3002<\/strong> \u5176\u4e2d\uff0c\u4f7f\u7528\u7c7b\u7684\u5c5e\u6027\u5b57\u5178\uff08<code>__dict__<\/code>\uff09\u6700\u4e3a\u76f4\u63a5\uff0c\u5b83\u5141\u8bb8\u8bbf\u95ee\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\uff1b<code>dir()<\/code>\u51fd\u6570\u5219\u8fd4\u56de\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u540d\u79f0\u7684\u5217\u8868\uff0c\u9002\u5408\u7b80\u5355\u7684\u904d\u5386\uff1b\u800cinspect\u6a21\u5757\u63d0\u4f9b\u66f4\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u5141\u8bb8\u5bf9\u7c7b\u8fdb\u884c\u8be6\u7ec6\u7684\u5206\u6790\u548c\u53cd\u5c04\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63a2\u8ba8\u8fd9\u4e9b\u65b9\u6cd5\u7684\u4f7f\u7528\u573a\u666f\u548c\u5177\u4f53\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528\u7c7b\u7684\u5c5e\u6027\u5b57\u5178<\/p>\n<\/p>\n<p><p>\u7c7b\u7684\u5c5e\u6027\u5b57\u5178<code>__dict__<\/code>\u662f\u4e00\u4e2a\u5b58\u50a8\u7c7b\u5c5e\u6027\u548c\u65b9\u6cd5\u7684\u5b57\u5178\uff0c\u901a\u8fc7\u5b83\u53ef\u4ee5\u65b9\u4fbf\u5730\u904d\u5386\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u76f4\u89c2\u4e14\u6613\u4e8e\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    class_var = &quot;I am a class variable&quot;<\/p>\n<p>    def __init__(self, value):<\/p>\n<p>        self.instance_var = value<\/p>\n<p>    def method(self):<\/p>\n<p>        pass<\/p>\n<h2><strong>\u904d\u5386\u7c7b\u5c5e\u6027\u5b57\u5178<\/strong><\/h2>\n<p>for key, value in MyClass.__dict__.items():<\/p>\n<p>    print(f&quot;{key}: {value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7c7b<code>MyClass<\/code>\uff0c\u7136\u540e\u901a\u8fc7\u904d\u5386<code>MyClass.__dict__<\/code>\u6765\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u5b8c\u6574\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u5305\u62ec\u9759\u6001\u65b9\u6cd5\u3001\u7c7b\u65b9\u6cd5\u548c\u5b9e\u4f8b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528dir()\u51fd\u6570<\/p>\n<\/p>\n<p><p><code>dir()<\/code>\u51fd\u6570\u662fPython\u5185\u7f6e\u7684\u4e00\u4e2a\u65b9\u6cd5\uff0c\u7528\u4e8e\u8fd4\u56de\u5bf9\u8c61\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u7684\u540d\u79f0\u5217\u8868\u3002\u5b83\u5bf9\u4e8e\u7b80\u5355\u7684\u904d\u5386\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    class_var = &quot;I am a class variable&quot;<\/p>\n<p>    def __init__(self, value):<\/p>\n<p>        self.instance_var = value<\/p>\n<p>    def method(self):<\/p>\n<p>        pass<\/p>\n<h2><strong>\u4f7f\u7528dir()\u51fd\u6570\u904d\u5386\u7c7b<\/strong><\/h2>\n<p>for attr in dir(MyClass):<\/p>\n<p>    print(attr)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7<code>dir()<\/code>\u51fd\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u7684\u540d\u79f0\u5217\u8868\u3002\u4f46\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<code>dir()<\/code>\u8fd4\u56de\u7684\u5217\u8868\u4e2d\u53ef\u80fd\u5305\u542b\u4e00\u4e9b\u7279\u6b8a\u65b9\u6cd5\u548c\u5c5e\u6027\uff08\u5982<code>__init__<\/code>\u3001<code>__dict__<\/code>\u7b49\uff09\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u9700\u6c42\u8fdb\u884c\u8fc7\u6ee4\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u4f7f\u7528inspect\u6a21\u5757<\/p>\n<\/p>\n<p><p>Python\u7684<code>inspect<\/code>\u6a21\u5757\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u53cd\u5c04\u80fd\u529b\uff0c\u53ef\u4ee5\u7528\u6765\u904d\u5386\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u5e76\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\uff0c\u4f8b\u5982\u65b9\u6cd5\u7684\u53c2\u6570\u5217\u8868\u3001\u6ce8\u91ca\u7b49\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import inspect<\/p>\n<p>class MyClass:<\/p>\n<p>    class_var = &quot;I am a class variable&quot;<\/p>\n<p>    def __init__(self, value):<\/p>\n<p>        self.instance_var = value<\/p>\n<p>    def method(self):<\/p>\n<p>        pass<\/p>\n<h2><strong>\u4f7f\u7528inspect\u6a21\u5757\u904d\u5386\u7c7b<\/strong><\/h2>\n<p>for name, obj in inspect.getmembers(MyClass):<\/p>\n<p>    if inspect.isfunction(obj) or inspect.ismethod(obj):<\/p>\n<p>        print(f&quot;Method: {name}&quot;)<\/p>\n<p>    elif not name.startswith(&#39;__&#39;):<\/p>\n<p>        print(f&quot;Attribute: {name} = {obj}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>inspect.getmembers()<\/code>\u51fd\u6570\u6765\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u6210\u5458\uff0c\u5e76\u901a\u8fc7<code>inspect.isfunction()<\/code>\u548c<code>inspect.ismethod()<\/code>\u6765\u5224\u65ad\u6210\u5458\u662f\u5426\u4e3a\u65b9\u6cd5\u3002\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\u53ef\u4ee5\u5bf9\u7c7b\u8fdb\u884c\u66f4\u6df1\u5165\u7684\u5206\u6790\uff0c\u4f8b\u5982\u83b7\u53d6\u65b9\u6cd5\u7684\u53c2\u6570\u5217\u8868\u3001\u7c7b\u578b\u6ce8\u91ca\u7b49\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u904d\u5386\u5b9e\u4f8b\u7684\u5c5e\u6027<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u4e0d\u4ec5\u9700\u8981\u904d\u5386\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u8fd8\u9700\u8981\u904d\u5386\u7c7b\u5b9e\u4f8b\u7684\u5c5e\u6027\u3002\u5bf9\u4e8e\u7c7b\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528<code>__dict__<\/code>\u5c5e\u6027\u6765\u83b7\u53d6\u5b9e\u4f8b\u7684\u6240\u6709\u5c5e\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    def __init__(self, value):<\/p>\n<p>        self.instance_var = value<\/p>\n<p>        self.another_var = &quot;Another variable&quot;<\/p>\n<h2><strong>\u521b\u5efa\u7c7b\u7684\u5b9e\u4f8b<\/strong><\/h2>\n<p>obj = MyClass(42)<\/p>\n<h2><strong>\u904d\u5386\u5b9e\u4f8b\u7684\u5c5e\u6027<\/strong><\/h2>\n<p>for key, value in obj.__dict__.items():<\/p>\n<p>    print(f&quot;{key}: {value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u904d\u5386\u5b9e\u4f8b\u7684<code>__dict__<\/code>\u5c5e\u6027\uff0c\u6211\u4eec\u53ef\u4ee5\u83b7\u53d6\u5b9e\u4f8b\u7684\u6240\u6709\u5c5e\u6027\u53ca\u5176\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u9002\u7528\u4e8e\u9700\u8981\u83b7\u53d6\u5b9e\u4f8b\u5c5e\u6027\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u7ed3\u5408\u4f7f\u7528\u4e0d\u540c\u65b9\u6cd5<\/p>\n<\/p>\n<p><p>\u5728\u5b9e\u8df5\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\u4e0a\u8ff0\u4e0d\u540c\u7684\u65b9\u6cd5\uff0c\u4ee5\u6ee1\u8db3\u590d\u6742\u7684\u9700\u6c42\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>dir()<\/code>\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u540d\u79f0\uff0c\u7136\u540e\u7ed3\u5408<code>getattr()<\/code>\u51fd\u6570\u83b7\u53d6\u6bcf\u4e2a\u5c5e\u6027\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">class MyClass:<\/p>\n<p>    class_var = &quot;I am a class variable&quot;<\/p>\n<p>    def __init__(self, value):<\/p>\n<p>        self.instance_var = value<\/p>\n<p>    def method(self):<\/p>\n<p>        pass<\/p>\n<h2><strong>\u7ed3\u5408\u4f7f\u7528dir()\u548cgetattr()<\/strong><\/h2>\n<p>for attr in dir(MyClass):<\/p>\n<p>    if not attr.startswith(&#39;__&#39;):<\/p>\n<p>        attr_value = getattr(MyClass, attr)<\/p>\n<p>        if callable(attr_value):<\/p>\n<p>            print(f&quot;Method: {attr}&quot;)<\/p>\n<p>        else:<\/p>\n<p>            print(f&quot;Attribute: {attr} = {attr_value}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u8fdb\u884c\u66f4\u7ec6\u7c92\u5ea6\u7684\u63a7\u5236\u548c\u5206\u6790\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u6700\u4f73\u5b9e\u8df5\u548c\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u9009\u62e9\u5408\u9002\u7684\u65b9\u6cd5<\/strong>\uff1a\u6839\u636e\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u904d\u5386\u65b9\u6cd5\u3002\u5982\u679c\u9700\u8981\u83b7\u53d6\u8be6\u7ec6\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528<code>inspect<\/code>\u6a21\u5757\uff1b\u5982\u679c\u53ea\u9700\u8981\u83b7\u53d6\u540d\u79f0\u5217\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528<code>dir()<\/code>\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6ce8\u610f\u7279\u6b8a\u65b9\u6cd5\u548c\u5c5e\u6027<\/strong>\uff1a\u5728\u904d\u5386\u7c7b\u65f6\uff0c\u9700\u8981\u6ce8\u610fPython\u7684\u7279\u6b8a\u65b9\u6cd5\u548c\u5c5e\u6027\uff08\u5982<code>__init__<\/code>\u3001<code>__str__<\/code>\u7b49\uff09\uff0c\u6839\u636e\u9700\u6c42\u51b3\u5b9a\u662f\u5426\u9700\u8981\u8fc7\u6ee4\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6027\u80fd\u8003\u8651<\/strong>\uff1a\u5728\u5927\u578b\u9879\u76ee\u4e2d\uff0c\u904d\u5386\u7c7b\u53ef\u80fd\u4f1a\u5f71\u54cd\u6027\u80fd\uff0c\u5c24\u5176\u662f\u5728\u4f7f\u7528<code>inspect<\/code>\u6a21\u5757\u8fdb\u884c\u6df1\u5ea6\u5206\u6790\u65f6\u3002\u56e0\u6b64\uff0c\u9700\u8981\u6839\u636e\u5177\u4f53\u60c5\u51b5\u4f18\u5316\u4ee3\u7801\u6027\u80fd\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u5b9e\u4f8b\u5c5e\u6027\u4e0e\u7c7b\u5c5e\u6027\u7684\u533a\u522b<\/strong>\uff1a\u8981\u533a\u5206\u5b9e\u4f8b\u5c5e\u6027\u548c\u7c7b\u5c5e\u6027\uff0c\u5c24\u5176\u662f\u5728\u5904\u7406\u7c7b\u7684\u7ee7\u627f\u5173\u7cfb\u65f6\uff0c\u9700\u8981\u660e\u786e\u54ea\u4e9b\u5c5e\u6027\u662f\u5b9e\u4f8b\u5c5e\u6027\uff0c\u54ea\u4e9b\u662f\u7c7b\u5c5e\u6027\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\u548c\u5b9e\u8df5\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u4e2d\u9ad8\u6548\u5730\u904d\u5386\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u4ece\u800c\u5728\u5f00\u53d1\u4e2d\u7075\u6d3b\u8fd0\u7528\u8fd9\u4e9b\u6280\u5de7\u6765\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u904d\u5386\u4e00\u4e2a\u7c7b\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>dir()<\/code>\u51fd\u6570\u6765\u83b7\u53d6\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u7ed3\u5408<code>getattr()<\/code>\u51fd\u6570\uff0c\u53ef\u4ee5\u904d\u5386\u8fd9\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\u3002\u4f8b\u5982\uff0c\u4f7f\u7528<code>dir(MyClass)<\/code>\u53ef\u4ee5\u5217\u51fa<code>MyClass<\/code>\u7c7b\u4e2d\u7684\u6240\u6709\u6210\u5458\uff0c\u7136\u540e\u4f7f\u7528<code>getattr(MyClass, member)<\/code>\u6765\u8bbf\u95ee\u8fd9\u4e9b\u6210\u5458\uff0c\u8fdb\u884c\u76f8\u5e94\u7684\u64cd\u4f5c\u3002<\/p>\n<p><strong>Python\u4e2d\u662f\u5426\u6709\u7279\u5b9a\u7684\u65b9\u5f0f\u6765\u904d\u5386\u7c7b\u7684\u5b9e\u4f8b\uff1f<\/strong><br \/>\u662f\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u4f8b\u5bf9\u8c61\u7684<code>__dict__<\/code>\u5c5e\u6027\u6765\u8bbf\u95ee\u7c7b\u7684\u5b9e\u4f8b\u53d8\u91cf\u3002\u8fd9\u4e2a\u5c5e\u6027\u8fd4\u56de\u4e00\u4e2a\u5b57\u5178\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u5b9e\u4f8b\u7684\u6240\u6709\u5c5e\u6027\u548c\u5b83\u4eec\u7684\u503c\u3002\u901a\u8fc7\u904d\u5386\u8fd9\u4e2a\u5b57\u5178\uff0c\u53ef\u4ee5\u8f7b\u677e\u83b7\u53d6\u548c\u64cd\u4f5c\u5b9e\u4f8b\u7684\u6240\u6709\u5c5e\u6027\u3002<\/p>\n<p><strong>\u5728\u904d\u5386\u7c7b\u65f6\uff0c\u5982\u4f55\u533a\u5206\u79c1\u6709\u5c5e\u6027\u548c\u516c\u5171\u5c5e\u6027\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u79c1\u6709\u5c5e\u6027\u901a\u5e38\u4ee5\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\uff0c\u6bd4\u5982<code>__private_attr<\/code>\u3002\u5728\u4f7f\u7528<code>dir()<\/code>\u6216<code>__dict__<\/code>\u904d\u5386\u7c7b\u65f6\uff0c\u79c1\u6709\u5c5e\u6027\u4f1a\u4ee5<code>_ClassName__private_attr<\/code>\u7684\u5f62\u5f0f\u51fa\u73b0\u3002\u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5\u5c5e\u6027\u540d\u79f0\u6765\u533a\u5206\u516c\u5171\u5c5e\u6027\u548c\u79c1\u6709\u5c5e\u6027\uff0c\u516c\u5171\u5c5e\u6027\u901a\u5e38\u4e0d\u4f1a\u6709\u4e0b\u5212\u7ebf\u524d\u7f00\u6216\u53ea\u6709\u4e00\u4e2a\u4e0b\u5212\u7ebf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u904d\u5386\u7c7b\u7684\u4e3b\u8981\u65b9\u6cd5\u5305\u62ec\u4f7f\u7528\u7c7b\u7684\u5c5e\u6027\u5b57\u5178\u3001dir()\u51fd\u6570\u3001\u4ee5\u53ca\u53cd\u5c04\u6a21\u5757inspect\uff0c\u8fd9\u4e9b\u65b9\u6cd5\u5404 [&hellip;]","protected":false},"author":3,"featured_media":946297,"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\/946289"}],"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=946289"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/946289\/revisions"}],"predecessor-version":[{"id":946299,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/946289\/revisions\/946299"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/946297"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=946289"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=946289"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=946289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}