<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hayataka2049</author_name>
  <author_url>https://blog.hatena.ne.jp/hayataka2049/</author_url>
  <blog_title>静かなる名辞</blog_title>
  <blog_url>https://hayataka2049.hatenablog.jp/</blog_url>
  <categories>
    <anon>python</anon>
    <anon>Tips</anon>
    <anon>ネタ・小ネタ</anon>
  </categories>
  <description>はじめに クラスはcallされたら自分のクラスのインスタンスを返さないといけないと思っていませんか？ 一般論としてはその通りなのですが、Pythonではそうしないメカニズムも用意されています。 __new__を使えば割となんでもできます。もっとも、実用的な用途は相当限られるでしょう。 原理 こんな感じ。 クラス クラスは呼び出し可能です。そのオブジェクトは通常、そのクラスの新たなインスタンスのファクトリとして振舞いますが、 __new__() をオーバーライドして、バリエーションを持たせることもできます。クラス cls の新しいインスタンスを作るために呼び出されます。3. データモデル — P…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhayataka2049.hatenablog.jp%2Fentry%2F2019%2F08%2F15%2F151038&quot; title=&quot;【python】クラスを関数として使う - 静かなる名辞&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>2019-08-15 15:10:38</published>
  <title>【python】クラスを関数として使う</title>
  <type>rich</type>
  <url>https://hayataka2049.hatenablog.jp/entry/2019/08/15/151038</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
