{"id":3022,"date":"2021-11-20T16:02:46","date_gmt":"2021-11-20T16:02:46","guid":{"rendered":"https:\/\/www.pythontutorial.net\/?page_id=3022"},"modified":"2021-11-28T14:59:30","modified_gmt":"2021-11-28T14:59:30","slug":"python-import","status":"publish","type":"page","link":"https:\/\/www.pythontutorial.net\/python-oop\/python-import\/","title":{"rendered":"Python import"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will examine the Python import statement variants and how they work under the hood.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='import-module'>import module <a href=\"#import-module\" class=\"anchor\" id=\"import-module\" title=\"Anchor for import module\">#<\/a><\/h2>\n\n\n\n<p>When you import a module, Python does two things:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, check if the module has been loaded and cached in the sys.modules. If not, it will execute the module and create a reference to the module object.<\/li><li>Second, add the module name to the global namespace referencing the same module object.<\/li><\/ul>\n\n\n\n<p>The following program imports the math module and prints out the <code>math<\/code> object in the <code>sys.modules<\/code> and global namespace:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> sys\n<span class=\"hljs-keyword\">import<\/span> math\n\n\nprint(<span class=\"hljs-string\">'sys.modules:'<\/span>, hex(id(sys.modules&#91;<span class=\"hljs-string\">'math'<\/span>])))\n\n<span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-string\">'math'<\/span> <span class=\"hljs-keyword\">in<\/span> globals():\n    print(<span class=\"hljs-string\">'globals: '<\/span>, hex(id(globals()&#91;<span class=\"hljs-string\">'math'<\/span>])))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTTP\" data-shcb-language-slug=\"http\"><span><code class=\"hljs language-http\"><span class=\"hljs-attribute\">sys.modules<\/span>: 0x20456766590\n<span class=\"hljs-attribute\">globals<\/span>:  0x20456766590<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTTP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">http<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As you can see, the <code>math<\/code> variable references the same module object.<\/p>\n\n\n\n<p>If you import a module for the second time, Python does not execute the <code>math<\/code> module again but gets it from the <code>sys.modules<\/code> cache.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='from-module-import-object'>from module import object <a href=\"#from-module-import-object\" class=\"anchor\" id=\"from-module-import-object\" title=\"Anchor for from module import object\">#<\/a><\/h2>\n\n\n\n<p>When you import an object (a <a href=\"https:\/\/www.pythontutorial.net\/python-basics\/python-functions\/\">function<\/a>, a <a href=\"https:\/\/www.pythontutorial.net\/python-oop\/python-class\/\">class<\/a>, etc., ) from a module, Python does the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, check if the module has been loaded and cached in the <code>sys.modules<\/code>. If not, it will execute the module and create a reference to the module object.<\/li><li>Second, add the import object to the global namespace. <\/li><\/ul>\n\n\n\n<p>In this case, Python does not add a variable that references the module to the global namespace but a variable that references the imported object. <\/p>\n\n\n\n<p>The following example imports the <code>ceil<\/code> function from the <code>math<\/code> object:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> sys\n<span class=\"hljs-keyword\">from<\/span> pprint <span class=\"hljs-keyword\">import<\/span> pprint\n<span class=\"hljs-keyword\">from<\/span> math <span class=\"hljs-keyword\">import<\/span> ceil\n\nprint(<span class=\"hljs-string\">'sys.modules:'<\/span>, hex(id(sys.modules&#91;<span class=\"hljs-string\">'math'<\/span>])))\n\npprint(globals())\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sys.modules: <span class=\"hljs-number\">0x11d659c2130<\/span>\n{<span class=\"hljs-string\">'__annotations__'<\/span>: {},\n <span class=\"hljs-string\">'__builtins__'<\/span>: &lt;module <span class=\"hljs-string\">'builtins'<\/span> (built-in)&gt;,\n <span class=\"hljs-string\">'__cached__'<\/span>: None,\n <span class=\"hljs-string\">'__doc__'<\/span>: None,\n <span class=\"hljs-string\">'__file__'<\/span>: <span class=\"hljs-string\">'C:\/oop\/app.py'<\/span>,\n <span class=\"hljs-string\">'__loader__'<\/span>: &lt;_frozen_importlib_external.SourceFileLoader object at <span class=\"hljs-number\">0x0000011D65A008E0<\/span>&gt;,\n <span class=\"hljs-string\">'__name__'<\/span>: <span class=\"hljs-string\">'__main__'<\/span>,\n <span class=\"hljs-string\">'__package__'<\/span>: None,\n <span class=\"hljs-string\">'__spec__'<\/span>: None,\n <span class=\"hljs-string\">'ceil'<\/span>: &lt;built-in <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">ceil<\/span>&gt;,\n '<span class=\"hljs-title\">pprint<\/span>': &lt;<span class=\"hljs-title\">function<\/span> <span class=\"hljs-title\">pprint<\/span> <span class=\"hljs-title\">at<\/span> 0<span class=\"hljs-title\">x0000011D661C4040<\/span>&gt;,\n '<span class=\"hljs-title\">sys<\/span>': &lt;<span class=\"hljs-title\">module<\/span> '<span class=\"hljs-title\">sys<\/span>' <span class=\"hljs-params\">(built-in)<\/span>&gt;}<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this example, Python loads the <code>math<\/code> module into the <code>sys.modules<\/code>. However, it only creates a reference to the <code>ceil<\/code> function, not the <code>math<\/code> module object in the global namespace.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='from-module-import-object-as-object_alias'>from module import object as object_alias <a href=\"#from-module-import-object-as-object_alias\" class=\"anchor\" id=\"from-module-import-object-as-object_alias\" title=\"Anchor for from module import object as object_alias\">#<\/a><\/h2>\n\n\n\n<p>When you load an object from a module and use an alias, Python will do the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, check if the module has been loaded and cached in the <code>sys.modules<\/code>. If not, it will execute the module and create a reference to the module object.<\/li><li>Second, create an alias that references the imported object and add it to the global namespace. <\/li><\/ul>\n\n\n\n<p>For example, the following imports the <code>ceil<\/code> function from the math module and use the ceiling alias:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> sys\n<span class=\"hljs-keyword\">from<\/span> math <span class=\"hljs-keyword\">import<\/span> ceil <span class=\"hljs-keyword\">as<\/span> ceiling\n\nprint(<span class=\"hljs-string\">'sys.modules:'<\/span>, hex(id(sys.modules&#91;<span class=\"hljs-string\">'math'<\/span>])))\nprint(<span class=\"hljs-string\">'globals:'<\/span>, hex(id(globals()&#91;<span class=\"hljs-string\">'ceiling'<\/span>])))<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sys.modules: <span class=\"hljs-number\">0x1cc4f244ae0<\/span>\n{<span class=\"hljs-string\">'__annotations__'<\/span>: {},\n <span class=\"hljs-string\">'__builtins__'<\/span>: &lt;module <span class=\"hljs-string\">'builtins'<\/span> (built-in)&gt;,\n <span class=\"hljs-string\">'__cached__'<\/span>: None,\n <span class=\"hljs-string\">'__doc__'<\/span>: None,\n <span class=\"hljs-string\">'__file__'<\/span>: <span class=\"hljs-string\">'C:\/oop\/app.py'<\/span>,\n <span class=\"hljs-string\">'__loader__'<\/span>: &lt;_frozen_importlib_external.SourceFileLoader object at <span class=\"hljs-number\">0x000001CC4EA708E0<\/span>&gt;,\n <span class=\"hljs-string\">'__name__'<\/span>: <span class=\"hljs-string\">'__main__'<\/span>,\n <span class=\"hljs-string\">'__package__'<\/span>: None,\n <span class=\"hljs-string\">'__spec__'<\/span>: None,\n <span class=\"hljs-string\">'ceiling'<\/span>: &lt;built-in <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">ceil<\/span>&gt;,\n '<span class=\"hljs-title\">pprint<\/span>': &lt;<span class=\"hljs-title\">function<\/span> <span class=\"hljs-title\">pprint<\/span> <span class=\"hljs-title\">at<\/span> 0<span class=\"hljs-title\">x000001CC4F234040<\/span>&gt;,\n '<span class=\"hljs-title\">sys<\/span>': &lt;<span class=\"hljs-title\">module<\/span> '<span class=\"hljs-title\">sys<\/span>' <span class=\"hljs-params\">(built-in)<\/span>&gt;}<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='from-module-import'>from module import * <a href=\"#from-module-import\" class=\"anchor\" id=\"from-module-import\" title=\"Anchor for from module import *\">#<\/a><\/h2>\n\n\n\n<p>When you import everything from a module, Python will do the following: <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><span style=\"color: initial; font-size: revert;\">First, check if the module has been loaded and cached in the sys.modules. If not, it will execute the module and create a reference to the module object.<\/span><\/li><li>Second, add all symbols from the module <span style=\"font-size: revert; color: initial;\">to the global namespace<\/span>.<\/li><\/ul>\n\n\n\n<p>For example, the following imports all the objects from the math module:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> sys\n<span class=\"hljs-keyword\">from<\/span> pprint <span class=\"hljs-keyword\">import<\/span> pprint\n<span class=\"hljs-keyword\">from<\/span> math <span class=\"hljs-keyword\">import<\/span> *\n\nprint(<span class=\"hljs-string\">'sys.modules:'<\/span>, hex(id(sys.modules&#91;<span class=\"hljs-string\">'math'<\/span>])))\npprint(globals())<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sys.modules: <span class=\"hljs-number\">0x1e1ebf24b30<\/span>\n{<span class=\"hljs-string\">'__annotations__'<\/span>: {},\n <span class=\"hljs-string\">'__builtins__'<\/span>: &lt;module <span class=\"hljs-string\">'builtins'<\/span> (built-in)&gt;,\n <span class=\"hljs-string\">'__cached__'<\/span>: None,\n <span class=\"hljs-string\">'__doc__'<\/span>: None,\n <span class=\"hljs-string\">'__file__'<\/span>: <span class=\"hljs-string\">'C:\/oop\/app.py'<\/span>,\n <span class=\"hljs-string\">'__loader__'<\/span>: &lt;_frozen_importlib_external.SourceFileLoader object at <span class=\"hljs-number\">0x000001E1EB7408E0<\/span>&gt;,\n <span class=\"hljs-string\">'__name__'<\/span>: <span class=\"hljs-string\">'__main__'<\/span>,\n <span class=\"hljs-string\">'__package__'<\/span>: None,\n <span class=\"hljs-string\">'__spec__'<\/span>: None,\n <span class=\"hljs-string\">'acos'<\/span>: &lt;built-in <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">acos<\/span>&gt;,\n '<span class=\"hljs-title\">acosh<\/span>': &lt;<span class=\"hljs-title\">built<\/span>-<span class=\"hljs-title\">in<\/span> <span class=\"hljs-title\">function<\/span> <span class=\"hljs-title\">acosh<\/span>&gt;,\n '<span class=\"hljs-title\">asin<\/span>': &lt;<span class=\"hljs-title\">built<\/span>-<span class=\"hljs-title\">in<\/span> <span class=\"hljs-title\">function<\/span> <span class=\"hljs-title\">asin<\/span>&gt;,\n\n ....\n '<span class=\"hljs-title\">tau<\/span>': 6.283185307179586,\n '<span class=\"hljs-title\">trunc<\/span>': &lt;<span class=\"hljs-title\">built<\/span>-<span class=\"hljs-title\">in<\/span> <span class=\"hljs-title\">function<\/span> <span class=\"hljs-title\">trunc<\/span>&gt;}<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>As you can see clearly from the output, Python adds all the functions from the math module to global namespaces. In this case, if any symbols exist in the global namespace, Python will replace their references.<\/p>\n\n\n\n<p>This often leads to bugs that are difficult to track. Therefore, you should avoid using the from module import *<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='python-import-misconception'>Python import misconception <a href=\"#python-import-misconception\" class=\"anchor\" id=\"python-import-misconception\" title=\"Anchor for Python import misconception\">#<\/a><\/h2>\n\n\n\n<p>One of the most common misconceptions of the import statement is that many consider the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">from<\/span> math <span class=\"hljs-keyword\">import<\/span> ceil<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>is more efficient than:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">import<\/span> math<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Because the first statement imports only the <code>ceil<\/code> function while the second statement imports the whole <code>math<\/code> module.<\/p>\n\n\n\n<p>However, Python loads the whole <code>math<\/code> module in both cases.<\/p>\n\n\n\n<p>The first statement creates a symbol that references the <code>ceil<\/code> function from the <code>math<\/code> module while the second statement creates the <code>math<\/code> symbol that references the <code>math<\/code> module object.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>The Python <code>import<\/code> statement only loads a module once and caches it in the <code>sys.modules<\/code>.<\/li><li>Avoid using the <code>from module import *<\/code> because it may cause a bug.<\/li><li>Do not use <code>from module import object<\/code> to optimize the program speed because it won&#8217;t.<\/li><\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"3022\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-oop\/python-import\/\"\n\t\t\t\tdata-post-title=\"Python import\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"3022\"\n\t\t\t\tdata-post-url=\"https:\/\/www.pythontutorial.net\/python-oop\/python-import\/\"\n\t\t\t\tdata-post-title=\"Python import\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Summary: in this tutorial, you will examine the Python import statement variants and how they work under the hood. import module # When you import a module, Python does two things: First, check if the module has been loaded and cached in the sys.modules. If not, it will execute the module and create a reference [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":417,"menu_order":51,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-3022","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/3022","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/comments?post=3022"}],"version-history":[{"count":0,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/3022\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/pages\/417"}],"wp:attachment":[{"href":"https:\/\/www.pythontutorial.net\/wp-json\/wp\/v2\/media?parent=3022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}