def getConstants(self, expression):
    list = {}
    if (type(expression).__name__ == 'Constant'):
        list[expression.value] = expression.type
    if hasattr(expression, 'operands'):
        for p in expression.operands:
            if (type(p).__name__ == 'Constant'):
                list[p.value] = p.type
            elif hasattr(p, 'operands'):
                subList = self.getConstants(p)
                list = {**list, **subList}
    return list
def getConstants(self, expression):
    list = {}
    if (type(expression).__name__ == 'Constant'):
        list[expression.value] = expression.type
    if hasattr(expression, 'operands'):
        for p in expression.operands:
            if (type(p).__name__ == 'Constant'):
                list[p.value] = p.type
            elif hasattr(p, 'operands'):
                subList = self.getConstants(p)
                list = {**list, **subList}
    return list