Python Enumeration : Enum, IntEnum, IntFlag and Flag

preview_player
Показать описание

Contents:
00:00 Enumeration
00:26 Enum Constructor
03:48 Enum with start parameter
04:30 Constructing Enum from iterable
05:26 Constructing Enum from mapping
06:46 Enum Constructor with type parameter
08:32 Enum Constructor with module parameter
09:11 Enum Constructor with qualname parameter
10:07 Accessing elements of Enum
12:25 Iterating Enum elements
13:12 Enum element as key of dictionary
14:47 Extending Enum class
17:05 Enum with duplicate value
19:25 @unique - Ensuring enum with unique value
20:54 auto() - Assigning automatic value in Enum class
21:36 Generating custom auto() values
24:34 Enum comparision
26:29 Comparing Enum with other values
27:32 IntEnum
29:42 IntEnum operation with int
30:23 IntEnum as Dictionary key
30:44 IntFlag
31:32 Bitwise Operators on IntFlag
32:16 Bitwise Operator on int and IntFlag
33:40 Membership Operators on IntFlag
34:02 Flag
35:13 Flag Operations
35:47 Mixing Flag and Int
36:05 Notes
Рекомендации по теме
Комментарии
Автор

Good detailed video. Thank you.
I just will suggest you to use "f-string with '=' symbol" for printing. For example this f"{'Enum' in locals() = }" string will be printed as "'Enum' in locals() = True".

GevorgVardanyan
Автор

Nice tutorial. Surprisingly, I have never seen the use of enum class anywhere. Can you give an example an application of Enum?

judeleon
Автор

minute 22:52 you are printing "start" value twice.

LeaTex