<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>twx</author_name>
  <author_url>https://blog.hatena.ne.jp/twx/</author_url>
  <blog_title>ひろこま Hack Log</blog_title>
  <blog_url>https://hacker.hatenadiary.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>PythonでFlatten Flattenとは 「入れ子になっているリスト」を「入れ子になっていないリスト」にすることです。 こんな感じです。 [1,[2,3]] → [1,2,3] [1,[2,[3]]] → [1,2,3] [1,[2,{'foo': 3}]] → [1,2,{'foo':3}] [1,[2,'foo']] → [1,2,'foo'] PythonでFlatten ほい。 flatten.py def flatten(xs): result = [] for x in xs: if isinstance(x, collections.Iterable) and not i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhacker.hatenadiary.com%2Fentry%2F2019%2F04%2F03%2F234904&quot; title=&quot;PythonでFlatten - ひろこま Hack Log&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>https://cdn-ak.f.st-hatena.com/images/fotolife/t/twx/20190722/20190722145422.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-04-03 23:49:04</published>
  <title>PythonでFlatten</title>
  <type>rich</type>
  <url>https://hacker.hatenadiary.com/entry/2019/04/03/234904</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
