<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>pythonco</author_name>
  <author_url>https://blog.hatena.ne.jp/pythonco/</author_url>
  <blog_title>pythonco(ぱいそんこ)の日記</blog_title>
  <blog_url>https://pythonco.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>実行時にクラス定義を決めることができます。 class Foo: ans = raw_input('choose 1 or 2: ') if ans == '1': def hello(self): print 'hello, i am one.' elif ans == '2': def hello(self): print 'hello, i am two.' else: def hello(self): print 'hello, i am', Foo.ans Foo().hello() Foo().hello()実行例は以下のようになります choose 1 or 2: 2 hello…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpythonco.hatenadiary.org%2Fentry%2F20061001%2Fp3&quot; title=&quot; クラス定義は動的 - pythonco(ぱいそんこ)の日記&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>2006-10-01 00:00:02</published>
  <title> クラス定義は動的</title>
  <type>rich</type>
  <url>https://pythonco.hatenadiary.org/entry/20061001/p3</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
