<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tiginkgo</author_name>
  <author_url>https://blog.hatena.ne.jp/tiginkgo/</author_url>
  <blog_title>初心者のためのpython入門</blog_title>
  <blog_url>https://tiginkgo.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>カプセル化の続き 今回は前回に続き、カプセル化について説明します。今回はプライベートなクラス変数とプライベートなメソッドについて説明します。 クラス変数 クラス変数は、クラスに属する変数です。今まで定義してきた変数は、インスタンスに属するメンバ変数です。クラス変数とメンバ変数の違いは、クラス変数は全てのインスタンスで共有されるということです。例を見てみましょう。 # hero.py class Hero(): number = 0; # クラス変数 def __init__(self, name): self.name = name # 通常のメンバ変数 Hero.number += 1 de…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftiginkgo.hateblo.jp%2Fentry%2F20171222%2F1513871312&quot; title=&quot;カプセル化[2] - 初心者のための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>2017-12-22 00:48:32</published>
  <title>カプセル化[2]</title>
  <type>rich</type>
  <url>https://tiginkgo.hateblo.jp/entry/20171222/1513871312</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
