from__future__importannotationsfromtypingimportLiteral,UnionimportenumDEBUG=False## Observation point types#
[文档]classObservationPointType(enum.IntEnum):""" Enum to replace the previously generic constants This makes it possible to annotate where they are expected by typing something as ObservationPointType instead of Literal[0,1] """OP_BEFORE=0OP_AFTER=1
# For backwards compatibilityOP_BEFORE=ObservationPointType.OP_BEFOREOP_AFTER=ObservationPointType.OP_AFTERObservationPoint=tuple[Literal["insn","node","stmt","exit"],Union[int,tuple[int,int],tuple[int,int,int]],ObservationPointType]