def consts ( self ) : # We cannot use a set comprehension because consts do not need # to be hashable. consts = [ ] append_const = consts . append for instr in self . instrs : if isinstance ( instr , LOAD_CONST ) and instr . arg not in consts : append_const ( instr . arg ) return tuple ( consts )
python long list of #define constants
The constants referenced in this code object .
def consts(self):
        """The constants referenced in this code object.
        """
        # We cannot use a set comprehension because consts do not need
        # to be hashable.
        consts = []
        append_const = consts.append
        for instr in self.instrs:
            if isinstance(instr, LOAD_CONST) and instr.arg not in consts:
                append_const(instr.arg)
        return tuple(consts)