So, I'm seeing some very odd behavior in Maya 2017
(Not sure if this affects other versions, but this is the version I'm testing with)
import maya.api.OpenMaya as om
import maya.cmds as cmds
sphere = cmds.polySphere(name="sphere")
compare = cmds.polySphere(name="compare")
cmds.xform("{}.vtx[10]".format(sphere[0]), translation=(1,1,1))
selectionList = om.MSelectionList()
selectionList.add(sphere[0])
selectionList.add(compare[0])
sphereDagPath = selectionList.getDagPath(0)
compareDagPath = selectionList.getDagPath(1)
sphereMeshFn = om.MFnMesh(sphereDagPath)
compareMeshFn = om.MFnMesh(compareDagPath)
sphereMeshFn.getFloatPoints()[10].distanceTo(compareMeshFn.getFloatPoints()[10])
So, if you enter all the above in the Script Editor, and execute the last line, you'll sometimes get the correct answer: 2.485206365585327, and other times 0.0
So, you can test this by selecting the last line in the Script Editor, and press-and-hold CTRL-ENTER and watching the results go by in the Script Editor.
If you select just the sphereMeshFn.getFloatPoints()[10]part, and press-and-hold CTRL-ENTER, the vertex position will not change. Similarly, with the compareMeshFn.getFloatPoints()[10])part
If we enter these lines
x = sphereMeshFn.getFloatPoints()[10]
y = compareMeshFn.getFloatPoints()[10]
Sometimes, the value of x will change when y is assigned.
I really can't comprehend this particular behavior, and it seems like a bug to me.