How to find non manifold edges I have this mesh:



With a python script, I'd like to select edge loops in the upper part first:



And the ones in the lower part:



So I can close them some way (by a face, or by adding more loops).
How can I do that with Blender SDK? Thank you.

EDIT: I mean, find the edges by starting from the object data, and not by using the editor...
Select 1 edge of that type
Shift+G >> Amount of Faces Around an Edge.


When you do this, Blender posts the following action it took in python.





As for the raw bmesh method of detecting this:

You can find the Reference in this Link





For getting the Horizontal &amp; Vertical sets in two separate passes, I would inspect the verts like so:

Horizontal Case:


  All Edges Have the Same Z values for the start and end vertices.


Vertical Case: 


  All Edges Have different Z values for the start and end vertices.