<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>saitodevel01</author_name>
  <author_url>https://blog.hatena.ne.jp/saitodevel01/</author_url>
  <blog_title>saito’s blog</blog_title>
  <blog_url>https://saitodevel01.hatenadiary.org/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>Ruby</anon>
    <anon>言語ネタ</anon>
  </categories>
  <description>Rubyでは，Structクラスを用いることによって，特定のフィールドを持つクラスを簡単に作成することができます。 Foo = Struct.new(&quot;Foo&quot;, &quot;foo&quot;, &quot;bar&quot;) f = Foo.new(1, 2) p f.foo # 1 p f.bar # 2 一方、Pythonの場合、namedtupleというライブラリで同様の機能が提供されています。 namedtupleはPython2.6以降で利用可能です。 from collections import namedtuple Foo = namedtuple(&quot;Foo&quot;, &quot;foo bar&quot;) f = Foo(1, 2)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsaitodevel01.hatenadiary.org%2Fentry%2F20100605%2F1275728303&quot; title=&quot;PythonでRubyのStruct風の構造体を実現する - saito’s blog&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-06-05 17:58:23</published>
  <title>PythonでRubyのStruct風の構造体を実現する</title>
  <type>rich</type>
  <url>https://saitodevel01.hatenadiary.org/entry/20100605/1275728303</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
