get edges for each MeshPolygon
ao = bpy.context.active_object for p in ao.data.polygons: p for ek in p.edge_keys: ek
This results like
py.data.meshes['Plane'].polygons[0] (2, 3) (1, 3) (0, 1) (0, 2) bpy.data.meshes['Plane'].polygons[1] (0, 1) (1, 5) (4, 5) (0, 4) ...
Note diagonal vertices do not share each other.