Enum and IntEnum classes allow constants to have nice str() and repr()
<socket.socket fd=3, family=AddressFamily.AF_INET,
type=SocketKind.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 0)>
But when integer constants are flags that should be ORed, IntEnum
doesn't help, because the result of bitwise OR of two IntEnum instances
is int, and this value can't be represented as IntEnum.
We need new type IntFlags. It is like IntEnum, but has differences:
1. The value of an instance should be not limited to the set of
predefined constants. It can be a combination of predefined constants or
even arbitrary integer.
2. The result of "|", "&" and "~" operators for IntFlags arguments
should be an instance of the same IntFlags subclass.
3. It should have nice str() and repr().
>>> print(stat.S_IROTH | stat.S_IWOTH)
>>> stat.S_IROTH | stat.S_IWOTH