<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>podhmo</author_name>
  <author_url>https://blog.hatena.ne.jp/podhmo/</author_url>
  <blog_title>podhmoの日記</blog_title>
  <blog_url>https://podhmo.hatenadiary.org/</blog_url>
  <categories>
    <anon>python</anon>
  </categories>
  <description>オブジェクトのメソッドも形を整えれば、デコレータとしてつかえる。副次的な機能を追加するのに使えそう。 例(平均を計算するカウンタのメソッドをデコレータとして利用) 平均を返すカウンタを使った例。 f()を呼ぶと共に値はカウントされ、g()を呼ぶともにカウンタの値はリセットされる。 class AverageCounter(object): def __init__(self, convert = lambda x : x): self.initialize() self.convert = convert def initialize(self, *args, **kw): self.i = …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpodhmo.hatenadiary.org%2Fentry%2F20110327%2F1301244797&quot; title=&quot;デコレータは何も関数である必要はないわけで - podhmoの日記&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>2011-03-27 01:53:17</published>
  <title>デコレータは何も関数である必要はないわけで</title>
  <type>rich</type>
  <url>https://podhmo.hatenadiary.org/entry/20110327/1301244797</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
