IntEnum values behave like int in most cases, which is usually convenient, but they can cause problems if the developer doesn't pay attention to the type.
For example, a function might unexpectedly perform the wrong thing if another enumeration or an integer value is provided, instead of the proper enumeration value:
>>> def do_request(kind):
... if kind == RequestType.POST:
... print('POST')
... else:
... print('OTHER')
As an example, invoking do_request with RequestType.POST or 1 will do exactly the same thing:
>>> do_request(RequestType.POST)
POST
>>> do_request(1)
POST
When we want to avoid treating our enumerations as numbers, we can use enum.Enum, which provides enumerated values that are not considered plain numbers:
>>> from enum import Enum
>>>
>>> class RequestType(Enum):
... POST = 1
... GET = 2
>>>
>>> do_request(RequestType.POST)
POST
>>> do_request(1)
OTHER
So generally, if you need a simple set of enumerated values or possible states that rely on enum, Enum is safer, but if you need a set of numeric values that rely on enum, IntEnum will ensure that they behave like numbers.