{"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>\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 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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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>\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\">\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"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af<\/title>\n<meta name=\"description\" content=\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\" \/>\n<meta property=\"og:description\" content=\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\" \/>\n<meta property=\"og:site_name\" content=\"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-29T15:01:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-02T12:35:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u062f\u0642\u06cc\u0642\u0647\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"TechArticle\",\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\"},\"author\":{\"name\":\"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/538d354a8ce207aafe13c3090954cbdd\"},\"headline\":\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2)\",\"datePublished\":\"2022-06-29T15:01:18+00:00\",\"dateModified\":\"2025-03-02T12:35:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\"},\"wordCount\":78,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/quera.org\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg\",\"articleSection\":[\"\u067e\u0627\u06cc\u062a\u0648\u0646\",\"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"\u062a\u06a9\u0646\u0648\u0644\u0648\u0698\u06cc\",\"\u0628\u06a9\u200c\u0627\u0646\u062f\",\"\u0622\u0645\u0648\u0632\u0634\u200c\u067e\u0644\u0627\u0633\"],\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\",\"url\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\",\"name\":\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\",\"isPartOf\":{\"@id\":\"https:\/\/quera.org\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg\",\"datePublished\":\"2022-06-29T15:01:18+00:00\",\"dateModified\":\"2025-03-02T12:35:11+00:00\",\"description\":\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.\",\"breadcrumb\":{\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#breadcrumb\"},\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage\",\"url\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg\",\"contentUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg\",\"width\":1200,\"height\":800,\"caption\":\"coroutine \u067e\u0627\u06cc\u062a\u0648\u0646\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u062e\u0627\u0646\u0647\",\"item\":\"https:\/\/quera.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u062a\u06a9\u0646\u0648\u0644\u0648\u0698\u06cc\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/technology\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u0628\u06a9\u200c\u0627\u0646\u062f\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/technology\/backend\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"\u067e\u0627\u06cc\u062a\u0648\u0646\",\"item\":\"https:\/\/quera.org\/blog\/category\/developer\/technology\/backend\/python\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/quera.org\/blog\/#website\",\"url\":\"https:\/\/quera.org\/blog\/\",\"name\":\"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af\",\"description\":\"\u0647\u0645\u0647\u200c\u0686\u06cc\u0632 \u062f\u0631\u0628\u0627\u0631\u0647 \u062f\u0646\u06cc\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc\",\"publisher\":{\"@id\":\"https:\/\/quera.org\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/quera.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/quera.org\/blog\/#organization\",\"name\":\"\u06a9\u0648\u0626\u0631\u0627\",\"url\":\"https:\/\/quera.org\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png\",\"contentUrl\":\"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png\",\"width\":300,\"height\":300,\"caption\":\"\u06a9\u0648\u0626\u0631\u0627\"},\"image\":{\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.instagram.com\/quera.ir\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/538d354a8ce207aafe13c3090954cbdd\",\"name\":\"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fa-IR\",\"@id\":\"https:\/\/quera.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/fa5ea024dc60f99e59bc9ec780c71de1e7e170eaebc38e358c5bb0d59d68b4d4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/fa5ea024dc60f99e59bc9ec780c71de1e7e170eaebc38e358c5bb0d59d68b4d4?s=96&d=mm&r=g\",\"caption\":\"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","description":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/","og_locale":"fa_IR","og_type":"article","og_title":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","og_description":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.","og_url":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/","og_site_name":"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","article_published_time":"2022-06-29T15:01:18+00:00","article_modified_time":"2025-03-02T12:35:11+00:00","og_image":[{"width":1200,"height":800,"url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg","type":"image\/jpeg"}],"author":"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647","twitter_card":"summary_large_image","twitter_misc":{"\u0646\u0648\u0634\u062a\u0647\u200c\u0634\u062f\u0647 \u0628\u062f\u0633\u062a":"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647","\u0632\u0645\u0627\u0646 \u062a\u0642\u0631\u06cc\u0628\u06cc \u0628\u0631\u0627\u06cc \u062e\u0648\u0627\u0646\u062f\u0646":"6 \u062f\u0642\u06cc\u0642\u0647"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"TechArticle","@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#article","isPartOf":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/"},"author":{"name":"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/538d354a8ce207aafe13c3090954cbdd"},"headline":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2)","datePublished":"2022-06-29T15:01:18+00:00","dateModified":"2025-03-02T12:35:11+00:00","mainEntityOfPage":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/"},"wordCount":78,"commentCount":2,"publisher":{"@id":"https:\/\/quera.org\/blog\/#organization"},"image":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage"},"thumbnailUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg","articleSection":["\u067e\u0627\u06cc\u062a\u0648\u0646","\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","\u062a\u06a9\u0646\u0648\u0644\u0648\u0698\u06cc","\u0628\u06a9\u200c\u0627\u0646\u062f","\u0622\u0645\u0648\u0632\u0634\u200c\u067e\u0644\u0627\u0633"],"inLanguage":"fa-IR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/quera.org\/blog\/coroutine-in-python-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/","url":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/","name":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2) - \u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","isPartOf":{"@id":"https:\/\/quera.org\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage"},"image":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage"},"thumbnailUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg","datePublished":"2022-06-29T15:01:18+00:00","dateModified":"2025-03-02T12:35:11+00:00","description":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 | \u062f\u0631 \u0627\u06cc\u0646 \u0642\u0633\u0645\u062a \u0627\u0632 \u0633\u0631\u06cc\u200c\u0645\u0642\u0627\u0644\u0627\u062a \u00abCorotine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646\u00bb \u0628\u0647 \u067e\u06cc\u0627\u062f\u0647\u200c\u0633\u0627\u0632\u06cc \u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 coroutine\u0647\u0627 \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 \u0645\u06cc\u200c\u067e\u0631\u062f\u0627\u0632\u06cc\u0645.","breadcrumb":{"@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#breadcrumb"},"inLanguage":"fa-IR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/quera.org\/blog\/coroutine-in-python-2\/"]}]},{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#primaryimage","url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg","contentUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/06\/Coroutine-\u062f\u0631-\u067e\u0627\u06cc\u062a\u0648\u0646-\u0633\u0631\u06cc-\u06f2-1.jpg","width":1200,"height":800,"caption":"coroutine \u067e\u0627\u06cc\u062a\u0648\u0646"},{"@type":"BreadcrumbList","@id":"https:\/\/quera.org\/blog\/coroutine-in-python-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u062e\u0627\u0646\u0647","item":"https:\/\/quera.org\/blog\/"},{"@type":"ListItem","position":2,"name":"\u062a\u0648\u0633\u0639\u0647\u200c\u062f\u0647\u0646\u062f\u0647","item":"https:\/\/quera.org\/blog\/category\/developer\/"},{"@type":"ListItem","position":3,"name":"\u062a\u06a9\u0646\u0648\u0644\u0648\u0698\u06cc","item":"https:\/\/quera.org\/blog\/category\/developer\/technology\/"},{"@type":"ListItem","position":4,"name":"\u0628\u06a9\u200c\u0627\u0646\u062f","item":"https:\/\/quera.org\/blog\/category\/developer\/technology\/backend\/"},{"@type":"ListItem","position":5,"name":"\u067e\u0627\u06cc\u062a\u0648\u0646","item":"https:\/\/quera.org\/blog\/category\/developer\/technology\/backend\/python\/"},{"@type":"ListItem","position":6,"name":"Coroutine \u062f\u0631 \u067e\u0627\u06cc\u062a\u0648\u0646 (2)"}]},{"@type":"WebSite","@id":"https:\/\/quera.org\/blog\/#website","url":"https:\/\/quera.org\/blog\/","name":"\u06a9\u0648\u0626\u0631\u0627\u200c\u0628\u0644\u0627\u06af","description":"\u0647\u0645\u0647\u200c\u0686\u06cc\u0632 \u062f\u0631\u0628\u0627\u0631\u0647 \u062f\u0646\u06cc\u0627\u06cc \u0628\u0631\u0646\u0627\u0645\u0647\u200c\u0646\u0648\u06cc\u0633\u06cc","publisher":{"@id":"https:\/\/quera.org\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/quera.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fa-IR"},{"@type":"Organization","@id":"https:\/\/quera.org\/blog\/#organization","name":"\u06a9\u0648\u0626\u0631\u0627","url":"https:\/\/quera.org\/blog\/","logo":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png","contentUrl":"https:\/\/quera.org\/blog\/wp-content\/uploads\/2022\/09\/logo-quera22-e1574766184574.png","width":300,"height":300,"caption":"\u06a9\u0648\u0626\u0631\u0627"},"image":{"@id":"https:\/\/quera.org\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.instagram.com\/quera.ir\/"]},{"@type":"Person","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/538d354a8ce207aafe13c3090954cbdd","name":"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647","image":{"@type":"ImageObject","inLanguage":"fa-IR","@id":"https:\/\/quera.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/fa5ea024dc60f99e59bc9ec780c71de1e7e170eaebc38e358c5bb0d59d68b4d4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/fa5ea024dc60f99e59bc9ec780c71de1e7e170eaebc38e358c5bb0d59d68b4d4?s=96&d=mm&r=g","caption":"\u0641\u0631\u0647\u0627\u062f \u0631\u0636\u0627\u0632\u0627\u062f\u0647"}}]}},"_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}]}}