<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sugyan</author_name>
  <author_url>https://blog.hatena.ne.jp/sugyan/</author_url>
  <blog_title>すぎゃーんメモ</blog_title>
  <blog_url>https://memo.sugyan.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>関数は、func_codeというattributeにcode objectなるものが入っているそうな。 これが実際に行う処理を持っているようなので、呼び出したときの処理をここで変更することができる。 &gt;&gt;&gt; def hoge(): ... print 'hoge' ... &gt;&gt;&gt; def fuga(): ... print 'fuga' ... &gt;&gt;&gt; hoge() hoge &gt;&gt;&gt; fuga() fuga &gt;&gt;&gt; hoge.func_code = fuga.func_code &gt;&gt;&gt; hoge() fuga &gt;&gt;&gt; なるほどねー。こんなことができるのか。 だんだんPythonが面白くなってき…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmemo.sugyan.com%2Fentry%2F20090710%2F1247154300&quot; title=&quot;関数の呼び出し時の処理を入れ替える - すぎゃーんメモ&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>2009-07-10 00:45:00</published>
  <title>関数の呼び出し時の処理を入れ替える</title>
  <type>rich</type>
  <url>https://memo.sugyan.com/entry/20090710/1247154300</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
