<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yuheiomori0718</author_name>
  <author_url>https://blog.hatena.ne.jp/yuheiomori0718/</author_url>
  <blog_title>メモ置き場</blog_title>
  <blog_url>https://y0m0r.hateblo.jp/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>「初めてのPython」で紹介されてるデコレータで、適用されて関数が呼ばれた回数を出力する。 class Tracer(object): &quot;&quot;&quot;関数の呼び出し回数を保存して出力するデコレータ&quot;&quot;&quot; def __init__(self, func): self.calls = 0 self.func = func def __call__(self, *args): self.calls += 1 print &quot;call %s to %s&quot; % (self.calls, self.func.__name__) self.func(*args) @Tracer def spam(): &quot;&quot;&quot;spa…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fy0m0r.hateblo.jp%2Fentry%2F20130719%2F1374229106&quot; title=&quot;クラスデコレータで__name__と__doc__を保持する - メモ置き場&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>http://ecx.images-amazon.com/images/I/51NEcEa4PiL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2013-07-19 19:18:26</published>
  <title>クラスデコレータで__name__と__doc__を保持する</title>
  <type>rich</type>
  <url>https://y0m0r.hateblo.jp/entry/20130719/1374229106</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
