<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>babaye</author_name>
  <author_url>https://blog.hatena.ne.jp/babaye/</author_url>
  <blog_title>babaye's notes</blog_title>
  <blog_url>https://babaye.hatenablog.com/</blog_url>
  <categories>
    <anon>プログラミング</anon>
  </categories>
  <description>TL;DR クラス、インスタンスとは メソッドとは コンストラクターとは (__init__と__new__) TL;DR __new__はインスタンスを作る前に実行されるもの __init__はインスタンスが作られた後に実行されるもの さらに詳しく __new__はインスタンス作成にまつわる挙動を書くのに便利。typeを戻り値として設定する必要があり、その戻り値が新しいインスタンスのtypeとなる __init__はインスタンスの変数を定義するのに便利（self.hogeのようなやつ）。戻り値は設定できないので、すでに作成されたインスタンスの変数を設定するのに使われる __new__と__i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbabaye.hatenablog.com%2Fentry%2F2019%2F07%2F13%2F180916&quot; title=&quot;(python) __new__と__init__の違いについて：具体例と解説 - babaye&amp;#39;s notes&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>https://cdn-ak.f.st-hatena.com/images/fotolife/b/babaye/20200520/20200520114458.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-07-13 18:09:16</published>
  <title>(python) __new__と__init__の違いについて：具体例と解説</title>
  <type>rich</type>
  <url>https://babaye.hatenablog.com/entry/2019/07/13/180916</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
