remove doubles with Bmesh data

i build the verts and edges for a new primitive

then before i create the bmesh mesh itself i tried to use the remove double

bmesh.ops.remove_doubles(bm, verts=bm.verts[:], dist=0.2)

i always get an error that

ReferenceError: BMesh data of type BMVert has been removed

can someone give a simple example n how to use this bmesh command

thanks