Scripting: separating selection results in edgeless mesh Whenever I use a script to separate a mesh by means of a selection the separated mesh contains no edges (only vertices). In contrast, separated meshes always contain edges when either manually selecting and separating  within the GUI or selecting manually and then separating in the python console. I use the following code to separate a mesh:

bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(bpy.data.objects['OBJECT_NAME'].data)

# Generate a certain set from vertices from the bmesh
# This function only generates vertices that are connected by edges
# and form a rectangular shape over the mesh 
vertices = get_some_vertices(bm)

for v in vertices:
    v.select = True
    bm.select_history.add(v)
bpy.ops.mesh.separate(type='SELECTED')


If make a selection manually, and then just run &gt;&gt;&gt; bpy.ops.mesh.separate(type='SELECTED')
in the console the result contains edges, as expected.

Can anyone reproduce this or explain why my new mesh does not have edges given my code?

$ blender --version # (tried another version as well)
Blender 2.79 (sub 2)
build date: 2018-02-22
Instead of selecting vertices of the bmesh, one should additionally select the corresponding edges and faces to create a new mesh containing them. It seems that when programmatically operating on a bmesh blender is a bit more literal on what you select than it is when selecting manually in edit mode.