Obviously the enum module has multiple classes and such with a lot of subtle details to it, so it isn't necessarily a small API, but the use of sys._getframe() made me want to see if I could replicate API for enum.Enum in less code. from typing import TYPE_CHECKING if TYPE_CHECKING: from enum import Enum, auto else: from basicenum.compat import Enum, auto Have type checkers check against enum while execution uses basicenum.compat As long as you don't rely on type(enum.variant) to be the same as how enum.Enum works, this trick should work (once again, assuming I didn't miss anything).