August 2018
Intermediate to advanced
366 pages
10h 14m
English
Typically, enumerations are implemented by mapping symbolic names to numeric values; this is allowed in Python through enum.IntEnum:
>>> from enum import IntEnum >>> >>> class RequestType(IntEnum): ... POST = 1 ... GET = 2 >>> >>> request_type = RequestType.POST >>> print(request_type) RequestType.POST