Updating Object Info node output values

I have a simple material set up
When i move the cube around the color changes, implying that the vector of Location is changing. I have a python script that reads the values of all the node inputs and outputs and prints them. However, the location of the object never changes.

import bpy

context = bpy.context
scene = context.scene

mat = bpy.context.active_object.active_material
nodes = mat.node_tree.nodes

#active_node = scene.active_node
#currNode = bpy.context.scene.node_tree.nodes.active
num = len(nodes)
print("\n\nThere are ",num," nodes\n")

for i in range(num):
    numInputs = len(nodes[i].inputs)
    numOutputs = len(nodes[i].outputs)
    print("\n(Name %s) -  #inputs %d # outputs %d\n" %(nodes[i].name,numInputs,numOutputs))

    if numInputs > 0:
        print("              Inputs:")
        for j in range(numInputs):
            name = nodes[i].inputs[j].name
            type = nodes[i].inputs[j].type
            label = nodes[i].label

            print("\nName %s Type %s Label %s " % (name,type,label))
            if type == 'VECTOR':
                vector = nodes[i].inputs[j].default_value
                print("Found vector: ",vector[0],vector[1],vector[2])
            elif type == 'VALUE':
                value = nodes[i].inputs[j].default_value
                print("Found value: ",value)
            elif type == 'RGBA':
                rgba = nodes[i].inputs[j].default_value
                print("Found RGBA: R %8.5f G %8.5f B %8.5f A %8.5f" % (rgba[0],rgba[1],rgba[2],rgba[3]))
    if numOutputs > 0:
        print("Outputs: \n")
        for j in range(numOutputs):
            name = nodes[i].outputs[j].name
            type = nodes[i].outputs[j].type
            print("Name %s Type %s" % (name,type))
            if type == 'VECTOR':
                vector = nodes[i].outputs[j].default_value
                print("Found vector: ",vector[0],vector[1],vector[2])
            elif type == 'VALUE':
                value = nodes[i].outputs[j].default_value
                print("Found value: ",value)

I have attached the blend file.
value.blend (542.2 KB)

Any help would be greatly appreciated

Vector values behave strangely. I have same problem, and I’m not the only one. See my post here and another on the blender stack exchange.