tobgu/pyrsistent

Best way to insert multiple elements into a `pvector`?

Opened this issue · 0 comments

Is there a recommended way to insert multiple elements at a position in a pvector? The equivalent of the following Python list code:

>>> xs = [1, 2, 6, 7]
>>> xs[2:2] = [3, 4, 5]
>>> xs
[1, 2, 3, 4, 5, 6, 7]

I can see I could join three pvectors if necessary: a prefix vector, the inserted elements and a suffix vector but I figure there's probably a better way?