<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>HiHiroaki</author_name>
  <author_url>https://blog.hatena.ne.jp/HiHiroaki/</author_url>
  <blog_title>気になるITまわり</blog_title>
  <blog_url>https://hihiroaki.hatenadiary.org/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>しばらくPythonから離れていたので、細かいところを忘れていたのでメモ。 アクセス制限 PythonにはJavaのようにprivateとかprotectedみたいなアクセス修飾子がない。「_(アンダーバー)」による規則として扱う。 「_」のようにアンダーバーがひとつの場合は、オブジェクトの中で使用する変数。やろうと思えばオブジェクトの外からアクセスできるけど、あくまでクラスを作った人の意図を表すものとして使用する。「__」のようにアンダーバーが2つの場合は、外からは簡単にアクセスできなくなる変数、Javaで言うところのprivateみたいな感じ。 class Foo: def __init_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhihiroaki.hatenadiary.org%2Fentry%2F20110510%2F1305019712&quot; title=&quot;Pythonにおけるアクセス修飾子 - 気になるITまわり&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-05-10 18:28:32</published>
  <title>Pythonにおけるアクセス修飾子</title>
  <type>rich</type>
  <url>https://hihiroaki.hatenadiary.org/entry/20110510/1305019712</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
