Movatterモバイル変換


[0]ホーム

URL:


Build Enumerations of Constants With Python's Enum

Building Enumerations With Python's enum

Some programming languages, such as Java and C++, have built-in support for a data type calledenumerations, commonly referred to asenums. Enums enable you to create sets of logically related constants that you can access through the enumeration itself. Unlike these languages, Python doesn’t have a dedicated syntax for enums. However, the Pythonstandard library provides anenum module that offers support for enumerations through theEnum class.

If you’re familiar with enums from other languages and wish to use them in Python, or if you simply want to learn how to work with enumerations, then this video course is designed for you.

In this video course, you’ll discover how to:

  • Createenumerations of constants using Python’sEnum class
  • Interact with enumerations and theirmembers in Python
  • Customize enumeration classes by addingnew functionalities
  • Applypractical examples to gain a deeper understanding of the benefits of using enumerations

Additionally, you’ll explore other specific enumeration types available in theenum module, such asIntEnum,IntFlag, andFlag. These specialized enums will expand your repertoire.

To get the most out of this video course, you should be familiar withobject-oriented programming andinheritance in Python.

What’s Included:

Downloadable Resources:

Related Learning Paths:

Start Now

Getting to Know Enumerations in Python

2 Lessons 5m

  1. 1. Building Enumerations With Python's enum (Overview)02:06
  2. 2. Getting to Know Enumerations03:41

Creating Enumerations With Python's enum

4 Lessons 17m

  1. 1. Creating Enumerations in Python05:28
  2. 2. Creating More Enumerations02:53
  3. 3. Creating Enumerations With the Functional API05:26
  4. 4. Using Automatic Values, Aliases, and Unique Values03:58

Working With Enumerations in Python

3 Lessons 13m

  1. 1. Working With Enumerations in Python04:37
  2. 2. Using Enumerations in if and match Statements02:55
  3. 3. Comparing and Sorting Enumerations05:52

Diving Deeper Into Enumerations

2 Lessons 14m

  1. 1. Extending Enumerations With New Behavior06:51
  2. 2. Exploring Other Enumeration Classes07:43

Reviewing What You've Learned

2 Lessons 8m

  1. 1. Using Enumerations: Two Practical Examples07:07
  2. 2. Building Enumerations With Python's enum (Summary)01:20
Start Now

AboutDarren Jones

With 20 years as a teacher of music technology, Darren is keen to bring his skills to the Python table.

» More about Darren

Each tutorial at Real Python is created by a team of developers so that it meets our high quality standards. The team members who worked on this tutorial are:

Related Courses:

← Browse All Courses


[8]ページ先頭

©2009-2026 Movatter.jp