<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nishiohirokazu</author_name>
  <author_url>https://blog.hatena.ne.jp/nishiohirokazu/</author_url>
  <blog_title>西尾泰和のはてなダイアリー</blog_title>
  <blog_url>https://nishiohirokazu.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>概要 このPEPはジェネレータのAPIと構文を改善して、シンプルなコルーチンとして使えるようにすることを提案する。 動機 コルーチンはいろいろなアルゴリズムを表現する自然な方法である。たとえば、シミュレーション、ゲーム、非同期I/O、そしてイベントドリブンプログラミングや協調的マルチタスクの他の形だ。 Pythonのジェネレータ関数はほとんどコルーチンだ、しかし完全にではない、なぜなら値を作って処理を一時停止することは許すが、処理を再開するときに値や例外を渡す方法がないからだ。 実装例 1. ジェネレータ関数が最初に呼ばれたときに自動的に最初のyieldまで処理が進むようにする “consum…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnishiohirokazu.hatenadiary.org%2Fentry%2F20100801%2F1280656890&quot; title=&quot;抜粋翻訳 PEP 342: Coroutines via Enhanced Generators - 西尾泰和のはてなダイアリー&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2010-08-01 19:01:30</published>
  <title>抜粋翻訳 PEP 342: Coroutines via Enhanced Generators</title>
  <type>rich</type>
  <url>https://nishiohirokazu.hatenadiary.org/entry/20100801/1280656890</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
