selection history from "shortest path"? is it possible to retrieve the selection history(the specific sequence) of vertices selected using "shortest path"?

Using bmesh, I can get the selection history by doing:

vertlist = [elem.index for elem in bm.select_history if isinstance(elem, bmesh.types.BMVert)]


But this unfortunately only works for verts, that have been manually selected(by hand and via "next active").

If anybody has any insight into this, I'd appreciate it.
this script will help you

import bpy, bmesh

print("*"*50)
oa = bpy.context.active_object
obj = bpy.context.object

bpy.ops.mesh.shortest_path_select() #add for request

me = obj.data
bm = bmesh.from_edit_mesh(me)


v1,v2 = [elem for elem in bm.select_history if isinstance(elem, bmesh.types.BMVert)]

list = [v1]
verts = len([v.index for v in bm.verts if v.select])

cont=0

while cont&lt; verts:
    v=list[cont]
    edges = v.link_edges

    for e in edges:
        if e.select:
            vn = e.other_vert(v)
            if vn not in list:
                list.append(vn)

    cont+=1

print(list)

for v in list:
    print(v.index)
bmesh.update_edit_mesh(me, True)