Enumeration in Python #Enumeration #Enum #Python #AmTechLearner

preview_player
Показать описание
An enumeration is a complete, ordered listing of all the items in a collection. The term is commonly used in mathematics and computer science to refer to a listing of all of the elements of a set. The precise requirements for an enumeration depend on the discipline of study and the context of a given problem.

Рекомендации по теме
Комментарии
Автор

Thank You, adding few more details

1. Enum introduced in Python 3.4

2. 00:01:14 - If you have same type-hint for your member names.. no need to repeat it.. In your case, it's int.. You can use syntax something like following..
class Jubilee(int, Enum):
silver = 25
gold = 40

3. One of the things that don't like about Enum, you can't extend them.. Imagine you have base Enum which is called Status.. and you want to extend Status Enum for other use-cases.. there is no pythonic way to do this..

hackwithharsha
join shbcf.ru