<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>はじめに Enumの基本的な使い方 宣言 値の取得 ループ 派生クラス(IntEnum・StrEnum) IntEnum StrEnum 数値・文字列からEnumを取得 auto関数：番号の自動割り振り 参考 はじめに Pythonで「定数」を扱うとき、次のようなコードを書いていませんか？ RED = 0 GREEN = 1 BLUE = 2 この書き方はシンプルですが、 タイプミスに弱い 補完が効きづらい といった問題があります。 そこで役立つのが Enum（列挙型）です。 Enumの基本的な使い方 宣言 Enumを継承したクラス内に、定数名 = 値の形式で書いていく。 数値だけでなく、文字…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Fpython%2Fenum&quot; title=&quot;【Python】Enum(列挙型)の使い方 - ランドML&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>2026-04-24 00:00:00</published>
  <title>【Python】Enum(列挙型)の使い方</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/python/enum</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
