<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chikatoike</author_name>
  <author_url>https://blog.hatena.ne.jp/chikatoike/</author_url>
  <blog_title>chikatoikeの日記</blog_title>
  <blog_url>https://chikatoike.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>Pythonを書いているときに無限ループを簡易的にチェックする方法を思い付いたのでメモ。 以下のように無限ループに陥ってしまったとします。 cond = True while cond: cond = True # いつまでたっても条件がFalseにならない print('hoge') このとき、とりあえず本来のループ脱出条件は無視して無限ループから抜け出そうと思い、イテレータを使う方法を思い付きました。 cond = True limit = iter(range(10000)) while cond: next(limit) # 無限ループチェック cond = True # いつまでたっ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fchikatoike.hatenadiary.jp%2Fentry%2F2013%2F08%2F27%2F072918&quot; title=&quot;無限ループを簡易的にチェックする - chikatoikeの日記&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>2013-08-27 07:29:18</published>
  <title>無限ループを簡易的にチェックする</title>
  <type>rich</type>
  <url>https://chikatoike.hatenadiary.jp/entry/2013/08/27/072918</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
