{"id":36673,"date":"2022-06-29T15:01:18","date_gmt":"2022-06-29T15:01:18","guid":{"rendered":"https:\/\/quera.org\/blog\/?p=36673"},"modified":"2025-03-02T16:05:11","modified_gmt":"2025-03-02T12:35:11","slug":"coroutine-in-python-2","status":"publish","type":"post","link":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/","title":{"rendered":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u062f\u0631 \u0628\u062e\u0634 \u0627\u0648\u0644 \u0627\u0632 \u0633\u0631\u06cc \u0645\u0642\u0627\u0644\u0627\u062a \u00ab<strong>Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646<\/strong>\u00bb \u0628\u0647 \u0645\u0627\u0647\u06cc\u062a \u0627\u06cc\u0646 \u0645\u0641\u0647\u0648\u0645 \u067e\u0631\u062f\u0627\u062e\u062a\u06cc\u0645 \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0627 \u0633\u0627\u06cc\u0631 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc \u0647\u0645\u200c\u0632\u0645\u0627\u0646\u06cc \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u0642\u0627\u06cc\u0633\u0647 \u06a9\u0631\u062f\u06cc\u0645. \u062f\u0631 \u0628\u062e\u0634 \u062f\u0648\u0645 \u0627\u0632 \u0627\u06cc\u0646 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0647 \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <strong>coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646<\/strong> \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"font-size:16px\"><strong><a href=\"https:\/\/quera.org\/blog\/coroutine-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (\u06f1)<\/a><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0628\u0631\u0627\u0633\u0627\u0633 \u0646\u06a9\u0627\u062a \u0627\u0634\u0627\u0631\u0647 \u0634\u062f\u0647 \u062f\u0631 \u0628\u062e\u0634 \u0627\u0648\u0644\u060c \u0628\u0647\u200c\u0637\u0648\u0631 \u062e\u0644\u0627\u0635\u0647 <em>coroutine\u200c\u200c<\/em>\u0647\u0627 \u062a\u0648\u0627\u0628\u0639\u06cc (<em>Task\u200c<\/em>\u0647\u0627\u06cc) \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u0645\u0631\u0627\u062d\u0644 \u0627\u0635\u0644\u06cc \u062e\u0648\u062f \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u062f\u0647\u0646\u062f \u0648 \u0641\u0642\u0637 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0646\u062a\u0631\u0644 \u0631\u0627 \u0628\u0647 \u0633\u0627\u06cc\u0631 Task\u0647\u0627 \u0648\u0627\u06af\u0630\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u0646\u062f \u06a9\u0647 \u0628\u0647 \u0627\u062a\u0645\u0627\u0645 \u0631\u0633\u06cc\u062f\u0647 \u0648 \u06cc\u0627 \u0645\u0646\u062a\u0638\u0631 \u0645\u0646\u0627\u0628\u0639 \u0628\u0627\u0634\u0646\u062f.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"406\" src=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/coroutine.png\" alt=\"\u0646\u062d\u0648\u0647\u200c\u06cc \u0639\u0645\u0644\u06a9\u0631\u062f coroutine\u0647\u0627\" class=\"wp-image-36674\" style=\"width:840px;height:500px\" srcset=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/coroutine.png 682w, https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/coroutine-300x179.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><figcaption class=\"wp-element-caption\">\u0646\u062d\u0648\u0647\u200c\u06cc \u0639\u0645\u0644\u06a9\u0631\u062f coroutine\u0647\u0627<\/figcaption><\/figure>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\" id=\"h-\u067e\u06cc\u0627\u062f\u0647-\u0633\u0627\u0632\u06cc-coroutine-\u0628\u0647-\u06a9\u0645\u06a9-generator\"><strong>\u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc Coroutine \u0628\u0647 \u06a9\u0645\u06a9 Generator<\/strong><\/h2>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u062a\u0648\u0644\u06cc\u062f\u06a9\u0646\u0646\u062f\u0647-\u0647\u0627\" style=\"font-size:18px\"><strong>\u062a\u0648\u0644\u06cc\u062f\u06a9\u0646\u0646\u062f\u0647\u200c\u0647\u0627<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u062a\u0648\u0644\u06cc\u062f\u06a9\u0646\u0646\u062f\u0647\u200c\u200c\u0647\u0627 \u06cc\u0627 <em>Generator<\/em>\u200c\u0647\u0627 \u0646\u0648\u0639 \u062e\u0627\u0635\u06cc \u0627\u0632 \u062a\u0648\u0627\u0628\u0639 \u0647\u0633\u062a\u0646\u062f \u06a9\u0647 \u06cc\u06a9 <em>Lazy iterator<\/em> \u0628\u0631\u0645\u06cc\u200c\u06af\u0631\u062f\u0627\u0646\u0646\u062f\u061b \u0628\u0647 \u0627\u06cc\u0646 \u0645\u0639\u0646\u06cc \u06a9\u0647 \u0634\u0645\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0645\u0627\u0646\u0646\u062f <em>List<\/em> \u0628\u0631 \u0631\u0648\u06cc \u0622\u0646\u200c\u0647\u0627 \u062d\u0644\u0642\u0647 \u0628\u0632\u0646\u06cc\u062f. \u0627\u0645\u0627 \u0628\u0631\u062e\u0644\u0627\u0641 <em>Lazy Iterator \u060cList<\/em>\u0647\u0627 \u0645\u062d\u062a\u0648\u06cc\u0627\u062a \u0631\u0627 \u062f\u0631 \u062f\u0631\u0648\u0646 <em>Memory<\/em> \u0630\u062e\u06cc\u0631\u0647 \u0646\u0645\u06cc\u200c\u06a9\u0646\u0646\u062f.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">&gt;&gt;&gt; def fib(count: int):\n...     a, b = 1, 0\n...     for _ in range(count):\n...         a, b = b, a + b\n...         yield b<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u062f\u0646\u0628\u0627\u0644\u0647\u200c\u06cc <em>Fibonacci<\/em> \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u0645\u0639\u0631\u0648\u0641 \u0628\u0631\u0627\u06cc <em>Generator<\/em>\u0647\u0627 \u0627\u0633\u062a. \u0647\u0631\u0628\u0627\u0631 \u062f\u0631 \u062d\u0644\u0642\u0647\u060c \u062f\u0648 \u0639\u062f\u062f \u0642\u0628\u0644\u06cc \u0628\u0627 \u06cc\u06a9\u062f\u06cc\u06af\u0631 \u062c\u0645\u0639 \u0645\u06cc\u200c\u0634\u0648\u0646\u062f \u0648 \u0646\u062a\u06cc\u062c\u0647 \u0631\u0627 <em>yield<\/em> \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0627\u0645\u0627 \u0647\u0645\u0627\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0642\u0628\u0644\u0627\u064b \u0627\u0634\u0627\u0631\u0647 \u0634\u062f \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639 \u0631\u0627 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u06a9\u0646\u06cc\u0645\u060c \u0645\u0642\u0627\u062f\u06cc\u0631 \u0631\u0627 \u0645\u0633\u062a\u0642\u06cc\u0645\u0627\u064b \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645\u060c \u0628\u0644\u06a9\u0647 <em>generator object<\/em> \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u0634\u0648\u062f. \u062f\u0631 \u0648\u0627\u0642\u0639 \u06a9\u062f \u062f\u0631\u0648\u0646 \u062a\u0627\u0628\u0639 \u0647\u0646\u0648\u0632 \u0627\u062c\u0631\u0627 \u0646\u0634\u062f\u0647 \u0627\u0633\u062a.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">&gt;&gt;&gt; gen = fib(5)\n&gt;&gt;&gt; print(gen)\n&lt;generator object fib at 0x7f192e4d2b20&gt;\n&gt;&gt;&gt; while True:\n...     print(next(gen))\n...     \n... \n1\n1\n2\n3\n5\nTraceback (most recent call last):\n  File \"&lt;input&gt;\", line 2, in &lt;module&gt;\n    print(next(gen))\nStopIteration<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0647\u0631\u0628\u0627\u0631 \u06a9\u0647 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <em>gen<\/em> \u060cnext \u0631\u0627 \u0641\u0631\u0627\u062e\u0648\u0627\u0646\u06cc \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645\u060c \u0627\u0632 \u062c\u0627\u06cc\u06cc \u06a9\u0647 \u0642\u0628\u0644\u0627\u064b \u0622\u0646 \u0631\u0627 \u062a\u0631\u06a9 \u06a9\u0631\u062f\u0647 \u0628\u0648\u062f\u06cc\u0645 \u0628\u0647 \u0622\u0646 \u0628\u0627\u0632 \u0645\u06cc\u200c\u06af\u0631\u062f\u06cc\u0645 \u0648 \u0628\u0627 yield\u200d \u0628\u0639\u062f\u06cc \u0627\u0632 \u0622\u0646 \u062e\u0627\u0631\u062c \u0645\u06cc\u200c\u0634\u0648\u06cc\u0645. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 <em>Generator<\/em> \u062a\u0645\u0627\u0645 \u0634\u0648\u062f (\u0635\u0631\u06cc\u062d \u06cc\u0627 \u0636\u0645\u0646\u06cc <em>return<\/em> \u0627\u0646\u062c\u0627\u0645 \u0634\u0648\u062f)\u060c <em>generator object<\/em> \u062e\u0637\u0627\u06cc <em>StopIteration<\/em> \u067e\u0631\u062a\u0627\u067e \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u0647\u200c\u0639\u0644\u0627\u0648\u0647 \u0627\u0645\u06a9\u0627\u0646 \u0627\u0631\u062a\u0628\u0627\u0637 \u0648 \u0627\u0631\u0633\u0627\u0644 \u062f\u0627\u062f\u0647 \u0628\u0647 <em>generator<\/em> \u0646\u06cc\u0632 \u0648\u062c\u0648\u062f \u062f\u0627\u0631\u062f.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">&gt;&gt;&gt; def double_inputs():\n...     while True:\n...         x = yield\n...         yield x * 2\n...\n&gt;&gt;&gt; gen = double_inputs()\n&gt;&gt;&gt; next(gen)       # run up to the first yield\n&gt;&gt;&gt; gen.send(10)    # goes into 'x' variable\n20\n&gt;&gt;&gt; next(gen)       # run up to the next yield\n&gt;&gt;&gt; gen.send(6)     # goes into 'x' again\n12<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0628\u0631\u0627\u06cc \u0622\u0634\u0646\u0627\u06cc\u06cc \u0628\u06cc\u0634\u062a\u0631 \u0628\u0627 <em>generator<\/em>\u0647\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u062f\u0648\u0631\u0647\u200c\u06cc&nbsp;<a href=\"https:\/\/quera.org\/college\/land\/register\/3078\/%D8%A2%D9%85%D9%88%D8%B2%D8%B4-%D9%BE%D8%B1%D9%88%DA%98%D9%87-%D9%85%D8%AD%D9%88%D8%B1-%D8%A8%D8%B1%D9%86%D8%A7%D9%85%D9%87%E2%80%8C%D9%86%D9%88%DB%8C%D8%B3%DB%8C-%D9%BE%D8%A7%DB%8C%D8%AA%D9%88%D9%86-%D9%BE%DB%8C%D8%B4%D8%B1%D9%81%D8%AA%D9%87-%D9%88-%D8%AA%D9%81%DA%A9%D8%B1%20%D8%B4%DB%8C%E2%80%8C%DA%AF%D8%B1%D8%A7\/\"><strong>\u0622\u0645\u0648\u0632\u0634 \u067e\u0627\u06cc\u062a\u0648\u0646<\/strong><\/a>&nbsp;\u067e\u06cc\u0634\u0631\u0641\u062a\u0647 \u06a9\u0648\u0626\u0631\u0627 \u06a9\u0627\u0644\u062c \u0645\u0631\u0627\u062c\u0639\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u0646\u0645\u0648\u0646\u0647-\u067e\u06cc\u0627\u062f\u0647-\u0633\u0627\u0632\u06cc-\u0628\u0631\u0627\u06cc-coroutine\" style=\"font-size:18px\"><strong>\u0646\u0645\u0648\u0646\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0628\u0631\u0627\u06cc Coroutine<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0642\u0628\u0644 \u0627\u0632 \u0627\u062f\u0627\u0645\u0647\u200c\u06cc \u0645\u0637\u0644\u0628 \u0628\u0627\u06cc\u062f \u0628\u0627 \u0645\u0633\u0626\u0644\u0647\u200c\u0627\u06cc \u06a9\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u0628\u0647 \u06a9\u0645\u06a9 <em>coroutine<\/em> \u062d\u0644 \u06a9\u0646\u06cc\u0645 \u0622\u0634\u0646\u0627 \u0634\u0648\u06cc\u0645 \u0648 \u0627\u0631\u062a\u0628\u0627\u0637 \u0622\u0646 \u0628\u0627 \u0627\u06cc\u0646 \u0645\u0641\u0647\u0648\u0645 \u0631\u0627 \u062f\u0631\u06a9 \u06a9\u0646\u06cc\u0645. \u0628\u0647 \u0647\u0645\u06cc\u0646 \u062f\u0644\u06cc\u0644 \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 \u0645\u0631\u062a\u0628\u200c\u0633\u0627\u0632\u06cc \u062c\u0627\u0644\u0628\u06cc \u0631\u0627 \u0645\u0639\u0631\u0641\u06cc \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 <strong>sleep sort<\/strong> \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0639\u0645\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 \u0628\u0647 \u062a\u0639\u062f\u0627\u062f \u0627\u0639\u062f\u0627\u062f\u060c \u062f\u0631 \u0622\u0631\u0627\u06cc\u0647\u200c\u0627\u06cc \u06a9\u0647 \u0642\u0635\u062f \u062f\u0627\u0631\u06cc\u0645 \u0645\u0631\u062a\u0628 \u06a9\u0646\u06cc\u0645 <em>coroutine<\/em> \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u062f\u0631 \u0647\u0631\u06a9\u062f\u0627\u0645 \u0627\u0632 \u0627\u06cc\u0646 <em>coroutine<\/em>\u0647\u0627\u060c \u0628\u0647 \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06cc \u0647\u0645\u0627\u0646 \u0639\u062f\u062f sleep \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0633\u067e\u0633 \u0639\u062f\u062f \u0631\u0627 \u0628\u0647 \u0644\u06cc\u0633\u062a\u0650 \u0645\u0631\u062a\u0628 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0647\u0631\u0686\u0647 \u0639\u062f\u062f \u0628\u0632\u0631\u06af\u062a\u0631 \u0628\u0627\u0634\u062f\u060c \u062b\u0627\u0646\u06cc\u0647\u200c\u06cc \u0628\u06cc\u0634\u062a\u0631\u06cc \u0645\u0646\u062a\u0638\u0631 \u0645\u06cc\u200c\u0645\u0627\u0646\u062f \u062a\u0627 \u0628\u0647 \u0644\u06cc\u0633\u062a \u0646\u0647\u0627\u06cc\u06cc \u0627\u0636\u0627\u0641\u0647 \u0634\u0648\u062f.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"610\" src=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/sleepsort.png\" alt=\"\u0646\u062d\u0648\u0647\u200c\u06cc \u0639\u0645\u0644\u06a9\u0631\u062f \u0627\u0644\u06af\u0648\u0631\u06cc\u062a\u0645 sleep sort\" class=\"wp-image-36686\" srcset=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/sleepsort.png 1024w, https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/sleepsort-300x179.png 300w, https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/sleepsort-768x458.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">sleep sort<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0628\u0631\u0627\u06cc \u0645\u062b\u0627\u0644 \u0627\u06af\u0631 \u0622\u0631\u0627\u06cc\u0647\u200c\u0627\u06cc \u0645\u0627\u0646\u0646\u062f <code>[3 ,4 ,1 ,2]<\/code> \u0631\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0631\u0648\u0634 \u0645\u0631\u062a\u0628 \u06a9\u0646\u06cc\u0645\u060c \u0627\u0628\u062a\u062f\u0627 \u0628\u0627\u06cc\u062f \u0628\u0647\u200c\u0627\u0632\u0627\u06cc \u0647\u0631 \u0639\u0646\u0635\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u0622\u0631\u0627\u06cc\u0647 <em>coroutine<\/em>\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u062f\u0631 \u0622\u0646 \u0628\u0647 \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06cc \u0645\u0642\u062f\u0627\u0631 \u0622\u0646 \u0639\u0646\u0635\u0631\u060c sleep \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645. \u0633\u067e\u0633 \u0628\u0627\u06cc\u062f <em>coroutine<\/em>\u200c\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647\u200c\u0627\u0646\u062f\u060c \u0627\u062c\u0631\u0627 \u0634\u0648\u0646\u062f. \u0645\u0631\u0627\u062d\u0644 \u0627\u062c\u0631\u0627 \u0631\u0627 \u0645\u06cc\u200c\u062a\u0648\u0627\u0646 \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0628\u06cc\u0627\u0646 \u06a9\u0631\u062f:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0627\u0628\u062a\u062f\u0627 <em>coroutine<\/em>\u0627\u06cc \u06a9\u0647 \u0628\u0631\u0627\u06cc \u06f2 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a\u060c \u0634\u0631\u0648\u0639 \u0628\u0647 \u06a9\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u0628\u0644\u0627\u0641\u0627\u0635\u0644\u0647 \u06a9\u0646\u062a\u0631\u0644 \u0631\u0627 \u0648\u0627\u06af\u0630\u0627\u0631 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0633\u067e\u0633 \u0628\u0647\u200c\u062a\u0631\u062a\u06cc\u0628 \u0628\u0631\u0627\u06cc \u06f1\u060c \u06f4\u200c \u0648 \u06f3 \u0647\u0645 \u0647\u0645\u06cc\u0646 \u0627\u062a\u0641\u0627\u0642 \u0645\u06cc\u200c\u0627\u0641\u062a\u062f. \u062f\u0631 \u0627\u062f\u0627\u0645\u0647\u060c \u0628\u0631\u0646\u0627\u0645\u0647 \u0645\u0646\u062a\u0638\u0631 \u0645\u06cc\u200c\u0645\u0627\u0646\u062f \u062a\u0627 \u06cc\u06a9\u06cc \u0627\u0632 <em>coroutine<\/em>\u200c\u0647\u0627 \u06a9\u0646\u062a\u0631\u0644 \u0628\u0631\u0646\u0627\u0645\u0647 \u0631\u0627 \u0628\u0647 \u062f\u0633\u062a \u0628\u06af\u06cc\u0631\u062f. \u0627\u0648\u0644\u06cc\u0646 <em>coroutine<\/em>\u0627\u06cc \u06a9\u0647 \u0627\u06cc\u0646 \u06a9\u0627\u0631 \u0631\u0627 \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc\u200c\u062f\u0647\u062f\u060c <em>coroutine<\/em>\u0627\u06cc \u0627\u0633\u062a \u06a9\u0647 \u0646\u0633\u0628\u062a \u0628\u0647 \u0633\u0627\u06cc\u0631 coroutine\u200c\u0647\u0627 \u06a9\u0645\u062a\u0631\u06cc\u0646 \u0632\u0645\u0627\u0646 \u0631\u0627 \u0645\u0646\u062a\u0638\u0631 \u0645\u06cc\u200c\u0645\u0627\u0646\u062f\u061b \u06cc\u0639\u0646\u06cc \u0627\u0628\u062a\u062f\u0627 \u06f1 \u06a9\u0646\u062a\u0631\u0644 \u0631\u0627 \u0628\u062f\u0633\u062a \u0645\u06cc\u200c\u06af\u06cc\u0631\u062f \u0648 \u06f1 \u0631\u0627 \u0628\u0647 \u0644\u06cc\u0633\u062a\u0650 \u0645\u0631\u062a\u0628 \u0627\u0636\u0627\u0641\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0633\u067e\u0633 \u0628\u0647\u200c\u062a\u0631\u062a\u06cc\u0628 \u0628\u0631\u0627\u06cc \u06f2\u060c \u06f3 \u0648 \u06f4 \u0646\u06cc\u0632 \u0627\u06cc\u0646 \u0627\u062a\u0641\u0627\u0642 \u0645\u06cc\u200c\u0627\u0641\u062a\u062f.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-\u067e\u06cc\u0627\u062f\u0647-\u0633\u0627\u0632\u06cc\" style=\"font-size:18px\"><strong>\u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0637\u0628\u0642 \u0645\u0648\u0627\u0631\u062f\u06cc \u06a9\u0647 \u062a\u0627\u0628\u0647\u200c\u062d\u0627\u0644 \u06af\u0641\u062a\u06cc\u0645\u060c \u0634\u06a9\u0644 \u06a9\u0644\u06cc \u06a9\u062f \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0628\u0627\u0634\u062f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def sleep_sort(numbers: List[int]) -&gt; List[int]:\n    result = []\n\n    def sleep_add(number: int): # this generator used for create coroutine for each number \n        # TODO: sleep for number second\n        result.append(number)\n\n    # TODO: start coroutine in such a list -&gt; [sleep_add(number) for number in numbers]\n    return result<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0647\u0645\u0627\u0646 \u0637\u0648\u0631 \u06a9\u0647 \u0627\u062d\u062a\u0645\u0627\u0644\u0627\u064b \u062d\u062f\u0633 \u0645\u06cc\u200c\u0632\u0646\u06cc\u062f\u060c \u0628\u0631\u0627\u06cc \u0635\u0628\u0631\u06a9\u0631\u062f\u0646 \u062f\u0631 \u062a\u0627\u0628\u0639 <em>sleep_add<\/em> \u0646\u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0627\u0632 <code>time.sleep<\/code> \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u0645. \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0627\u0631 \u0628\u0627\u06cc\u062f \u06cc\u06a9 <em>generator<\/em> \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u06cc\u0645 \u06a9\u0647 \u062a\u0627 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u0646\u06cc\u0627\u0632 \u0627\u0633\u062a\u060c \u0628\u0627 <em>yield<\/em> \u06a9\u0631\u062f\u0646 \u0627\u0632 \u0622\u0646 \u062e\u0627\u0631\u062c \u0634\u0648\u06cc\u0645 (\u06a9\u0646\u062a\u0631\u0644 \u0631\u0627 \u0648\u0627\u06af\u0630\u0627\u0631 \u06a9\u0646\u06cc\u0645.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def sleep(duration: float) -&gt; None:\n    now = time.time()\n    threshold = now + duration\n    while now &lt; threshold:\n        yield\n        now = time.time()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u062f\u0631 <em>generator<\/em> \u0628\u0627\u0644\u0627\u060c \u062f\u0631 \u0627\u0628\u062a\u062f\u0627\u060c \u0645\u062f\u062a\u200c\u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 \u06a9\u0627\u0631 <em>generator<\/em> \u0628\u0647 \u0627\u062a\u0645\u0627\u0645 \u0645\u06cc\u200c\u0631\u0633\u062f\u060c \u0645\u062d\u0627\u0633\u0628\u0647 \u0645\u06cc\u200c\u0634\u0648\u062f. \u0633\u067e\u0633 \u062a\u0627 \u0647\u0646\u06af\u0627\u0645\u06cc \u06a9\u0647 \u0632\u0645\u0627\u0646 \u0641\u0639\u0644\u06cc\u060c \u06a9\u0645\u062a\u0631 \u0627\u0632 \u0627\u06cc\u0646 \u0632\u0645\u0627\u0646 \u0627\u0633\u062a \u0628\u0627 <code>yield<\/code> \u0627\u0632 \u0622\u0646 \u062e\u0627\u0631\u062c \u0645\u06cc\u200c\u0634\u0648\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0639\u062f \u0627\u0632 \u06af\u0630\u0634\u062a\u0646 \u0627\u0632 \u0627\u06cc\u0646 \u0632\u0645\u0627\u0646\u060c \u06a9\u0627\u0631 <em>generator<\/em> \u0628\u0647 \u0627\u062a\u0645\u0627\u0645 \u0645\u06cc\u200c\u0631\u0633\u062f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0642\u062f\u0645 \u0628\u0639\u062f\u06cc \u0627\u06cc\u062c\u0627\u062f \u0686\u0627\u0631\u0686\u0648\u0628\u06cc \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627\u06a9\u0631\u062f\u0646 <em>coroutine<\/em>\u0647\u0627\u06cc \u0627\u06cc\u062c\u0627\u062f\u0634\u062f\u0647 \u0627\u0633\u062a.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def wait(tasks: Iterable[Generator]) -&gt; List[Any]:\n    pending = list(tasks)\n    tasks = {task: None for task in pending}\n    before = time.time()\n\n    while pending:\n        for gen in pending:\n            try:\n                tasks[gen] = gen.send(tasks[gen])\n            except StopIteration as e:\n                tasks[gen] = e.value\n                pending.remove(gen)\n\n    print(f\"duration: {time.time() - before:.3}\")\n    return list(tasks.values())<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u062a\u0627\u0628\u0639 <em>wait<\/em> \u06a9\u0647 \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627 \u06a9\u0631\u062f\u0646 <em>coroutine<\/em>\u0647\u0627 \u0627\u06cc\u062c\u0627\u062f \u0634\u062f\u0647 \u0627\u0633\u062a\u060c \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0639\u0645\u0644 \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 \u0627\u0628\u062a\u062f\u0627 \u0644\u06cc\u0633\u062a\u06cc \u0627\u0632 <em>coroutine<\/em>\u0647\u0627\u06cc\u06cc \u06a9\u0647 \u0628\u0627\u06cc\u062f \u0627\u062c\u0631\u0627 \u0634\u0648\u0646\u062f \u0631\u0627 \u0645\u06cc\u200c\u0633\u0627\u0632\u062f (<code>pending<\/code>)\u060c \u0633\u067e\u0633 \u062f\u06cc\u06a9\u0634\u0646\u0631\u06cc\u0650 <em>tasks<\/em> \u0631\u0627 \u0628\u0631\u0627\u06cc \u0646\u06af\u0647\u062f\u0627\u0631\u06cc \u062e\u0631\u0648\u062c\u06cc \u0647\u0631 <em>coroutine<\/em> \u0627\u06cc\u062c\u0627\u062f \u0645\u06cc\u200c\u06a9\u0646\u062f \u0648 \u062a\u0627 \u0632\u0645\u0627\u0646\u06cc \u06a9\u0647 <em>coroutine<\/em>\u0627\u06cc \u0628\u0631\u0627\u06cc \u0627\u062c\u0631\u0627 \u0648\u062c\u0648\u062f \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f(<code>while pending<\/code>)\u060c \u0622\u0646 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0631\u062f\u0647 (\u062f\u0631 \u0648\u0627\u0642\u0639 <code>gen.send<\/code> \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u06a9\u0646\u062a\u0631\u0644 \u0627\u062c\u0631\u0627 \u0631\u0627 \u0628\u0647 <em>coroutine<\/em> \u0645\u06cc\u200c\u062f\u0647\u062f) \u0648 \u0646\u062a\u06cc\u062c\u0647\u200c\u06cc \u0622\u0646 \u0631\u0627 \u0630\u062e\u06cc\u0631\u0647 \u0645\u06cc\u200c\u06a9\u0646\u062f. \u0647\u0645\u0686\u06cc\u0646 \u062f\u0631\u0635\u0648\u0631\u062a \u067e\u0631\u062a\u0627\u0628 \u062e\u0637\u0627\u06cc <code>StopIteration<\/code> (\u067e\u0627\u06cc\u0627\u0646 \u06a9\u0627\u0631 <em>coroutine<\/em>) \u0628\u0627 <code>try except<\/code> \u0645\u062f\u06cc\u0631\u06cc\u062a \u0648 \u0627\u0632 \u0644\u06cc\u0633\u062a \u0627\u062c\u0631\u0627 <code>pending<\/code> \u062d\u0630\u0641 \u0645\u06cc\u200c\u0634\u0648\u062f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u062f\u0631 \u0646\u0647\u0627\u06cc\u062a \u062a\u0627\u0628\u0639 <em>sleep_sort<\/em> \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0645\u06cc\u200c\u0634\u0648\u062f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def sleep_sort(numbers: List[int]) -&gt; List[int]:\n    result = []\n\n    def sleep_add(number: int) -&gt; Generator:\n        yield from sleep(number)\n        result.append(number)\n\n    wait([sleep_add(number) for number in numbers])\n    return result<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u062d\u0627\u0644 \u0627\u06af\u0631 \u0627\u06cc\u0646 \u062a\u0627\u0628\u0639 \u0631\u0627 \u0627\u062c\u0631\u0627 \u06a9\u0646\u06cc\u0645\u060c \u06cc\u06a9 \u062e\u0631\u0648\u062c\u06cc \u0645\u0634\u0627\u0628\u0647 \u0632\u06cc\u0631 \u062f\u0631\u06cc\u0627\u0641\u062a \u0645\u06cc\u200c\u06a9\u0646\u06cc\u0645:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">if __name__ == \"__main__\":\n    range_10 = list(range(10))\n    random.shuffle(range_10)\n    print(f\"range_10: {range_10}\")\n    print(f\"sleep_sort(range_10): {sleep_sort(range_10)}\")\n\n# OUTPUt\n# range_10: [1, 4, 8, 7, 9, 3, 0, 5, 6, 2]\n# duration: 9.0\n# sleep_sort(range_10): [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<\/code><\/pre>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading has-medium-font-size\" id=\"h-asyncio\"><strong>AsyncIO<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u06a9\u0627\u0631\u06cc \u06a9\u0647 \u062a\u0627 \u0628\u0647 \u0627\u06cc\u0646\u062c\u0627 \u0627\u0646\u062c\u0627\u0645 \u062f\u0627\u062f\u06cc\u0645\u060c \u0627\u062e\u062a\u0631\u0627\u0639 \u0627\u0648\u0644\u06cc\u0647\u200c\u06cc <em>asyncIO<\/em> \u0628\u0648\u062f. \u062f\u0631 \u0648\u0627\u0642\u0639 \u0627\u06cc\u0646 \u0642\u0637\u0639\u0647\u200c\u06a9\u062f \u0635\u0631\u0641\u0627\u064b \u062c\u0647\u062a \u0646\u0634\u0627\u0646 \u062f\u0627\u062f\u0646 \u0646\u062d\u0648\u0647\u200c\u06cc \u0627\u062c\u0631\u0627\u200c\u0634\u062f\u0646 <em>coroutine<\/em>\u200c\u0647\u0627 \u06af\u0641\u062a\u0647 \u0634\u062f\u0647 \u0648 \u0628\u0647 \u0627\u0646\u062f\u0627\u0632\u0647\u200c\u06cc \u06a9\u0627\u0641\u06cc \u0627\u0646\u0639\u0637\u0627\u0641\u200c\u067e\u0630\u06cc\u0631 \u0646\u06cc\u0633\u062a \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0646 \u0647\u0645\u0631\u0627\u0647 \u0628\u0627 \u0633\u0627\u06cc\u0631 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647\u200c\u0647\u0627 \u0628\u0647\u200c\u0633\u0627\u062f\u06af\u06cc \u0627\u0645\u06a9\u0627\u0646\u200c\u067e\u0630\u06cc\u0631 \u0646\u06cc\u0633\u062a. \u067e\u0633 \u062a\u0648\u0635\u06cc\u0647 \u0645\u06cc\u200c\u06a9\u0646\u0645 \u062f\u0631 \u06a9\u062f\u0646\u0648\u06cc\u0633\u06cc\u200c\u062a\u0627\u0646 \u0627\u0632 \u0627\u06cc\u0646 \u0631\u0648\u0634 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0646\u06a9\u0646\u06cc\u062f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0627\u0632 \u0646\u0633\u062e\u0647 \u06f3.\u06f5\u060c \u067e\u0627\u06cc\u062a\u0648\u0646 \u0627\u0632 <code>async def<\/code> \u0628\u0631\u0627\u06cc \u062a\u0639\u0631\u06cc\u0641 <em>coroutine<\/em> \u067e\u0634\u062a\u06cc\u0628\u0627\u0646\u06cc \u0645\u06cc\u200c\u06a9\u0646\u062f \u06a9\u0647 \u0635\u062f\u0627\u200c\u0632\u062f\u0646 \u0622\u0646\u060c <em>generator<\/em> \u0646\u062a\u06cc\u062c\u0647 \u0631\u0627 \u0628\u0631\u0646\u0645\u06cc\u200c\u06af\u0631\u062f\u0627\u0646\u062f. \u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <code>await<\/code> \u0642\u0627\u062f\u0631 \u0628\u0647 \u0631\u0641\u062a\u0627\u0631\u06cc \u0645\u0634\u0627\u0628\u0647 \u0628\u0627 <code>yield from<\/code> \u062f\u0631 \u0628\u0627\u0644\u0627 \u0647\u0633\u062a\u06cc\u0645.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u062d\u0627\u0644 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 <em>AsyncIO<\/em> \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u06cc\u0645 \u0631\u0627\u0647\u200c\u062d\u0644 \u0645\u0633\u0626\u0644\u0647\u200c\u06cc \u0628\u06cc\u0627\u0646\u200c\u0634\u062f\u0647 \u0631\u0627 \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a \u0628\u0627\u0632\u0646\u0648\u06cc\u0633\u06cc \u06a9\u0646\u06cc\u0645:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def sleep_sort(numbers: List[int]) -&gt; List[int]:\n    result = []\n\n    async def sleep_add(number: int) -&gt; Coroutine:\n        await asyncio.sleep(number)\n        result.append(number)\n\n    asyncio.run(asyncio.wait([sleep_add(number) for number in numbers]))\n    return result<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0645\u0633\u0644\u0645\u0627\u064b \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647\u200c\u06cc <em>AsyncIO<\/em> \u062c\u0632\u0626\u06cc\u0627\u062a \u0628\u0633\u06cc\u0627\u0631 \u0628\u06cc\u0634\u062a\u0631\u06cc \u0628\u0631\u0627\u06cc \u0627\u0631\u0627\u0626\u0647 \u062f\u0627\u0631\u062f\u060c \u0627\u0645\u0627 \u0645\u062a\u0623\u0633\u0641\u0627\u0646\u0647 \u0627\u0645\u06a9\u0627\u0646 \u067e\u0631\u062f\u0627\u062e\u062a\u0646 \u0628\u0647 \u0622\u0646 \u062f\u0631 \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0648\u062c\u0648\u062f \u0646\u062f\u0627\u0631\u062f. \u0648\u0644\u06cc \u0627\u0645\u06cc\u062f\u0648\u0627\u0631\u0645 \u062a\u0635\u0648\u06cc\u0631 \u0645\u0646\u0627\u0633\u0628\u06cc \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u0627\u06cc\u0646 \u062f\u0648 \u0645\u0642\u0627\u0644\u0647 \u0627\u0631\u0627\u0626\u0647 \u062f\u0627\u062f\u0647 \u0634\u062f\u0647 \u0628\u0627\u0634\u062f \u062a\u0627 \u0627\u062f\u0627\u0645\u0647\u200c\u06cc \u0627\u06cc\u0646 \u0645\u0633\u06cc\u0631 \u0631\u0627 \u0628\u0631\u0627\u06cc \u0634\u0645\u0627 \u0647\u0645\u0648\u0627\u0631\u062a\u0631 \u06a9\u0646\u062f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 \u06a9\u062f\u200c\u0647\u0627\u06cc \u0627\u06cc\u0646 \u0645\u0642\u0627\u0644\u0647 \u0628\u0647 \u0627\u06cc\u0646 <a href=\"https:\/\/github.com\/farhad-rezazadeh\/QueraCoroutine\" target=\"_blank\" rel=\"noopener\">\u0644\u06cc\u0646\u06a9<\/a> \u0645\u0631\u0627\u062c\u0639\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u062f\u0631 \u0628\u062e\u0634 \u0627\u0648\u0644 \u0627\u0632 \u0633\u0631\u06cc \u0645\u0642\u0627\u0644\u0627\u062a \u00abCoroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u0645\u0627\u0647\u06cc\u062a \u0627\u06cc\u0646 \u0645\u0641\u0647\u0648\u0645 \u067e\u0631\u062f\u0627\u062e\u062a\u06cc\u0645 \u0648 \u0622\u0646 \u0631\u0627 \u0628\u0627 \u0633\u0627\u06cc\u0631 \u0631\u0648\u0634\u200c\u0647\u0627\u06cc&#8230;<\/p>\n","protected":false},"author":27,"featured_media":36767,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64,46,48,78,298],"tags":[],"class_list":["post-36673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-developer","category-technology","category-backend","category-plus"],"_links":{"self":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/36673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/comments?post=36673"}],"version-history":[{"count":42,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/36673\/revisions"}],"predecessor-version":[{"id":47747,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/posts\/36673\/revisions\/47747"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/media\/36767"}],"wp:attachment":[{"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/media?parent=36673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/categories?post=36673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quera.org\/blog\/wp-json\/wp\/v2\/tags?post=36673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}