list slicing seems disabled in python scripting
So, Blender use Vector to describe all vector-like value in its own API, it is not only tuple but a well defined class with methods. Check the newest API here: Blender 2.80 API(or latest)

You will need to create Vector by yourself, don't wish Blender will get over-ridden parameter from tuples and other format:



So in your code:

middleNode = ((p1.x+p2.x)/2,(p1.y+p2.y)/2,(p1.z+p2.z)/2) # type: tuple(float,float,float)
v1 = v1[:i] + middleNode + v1[i:] # &lt;---- this one won't work


Your are asking python to stick a list of Vector to a tuple, not even a list, it will break. You can actually list it like v1[:i] + [middleNode,] to make python think its OK. But, the list is not all Vector but a tuple inserted between your list:



Python allow you to put any data inside a list and tuple, even they are not all same type.

So you should make your middleNode = Vector((x,y,x)) and wrap it into a list and concat them like before.