from enum import Enum

class BitEnum(int, Enum):
    def __new__(cls, *args):
        value = 1 << len(cls.__members__)
        return int.__new__(cls, value)

formats = BitEnum("formats", "i b blockquote")

from enum import IntEnum

class formats(IntEnum):
    i, b, blockquote = (1<<i for i in range(3))

Remove BitEnum class, use IntEnum
Remove BitEnum class, use IntEnum
