Saving an array containing multiple objects (n visual.shape) to file and reload into a new experiment

I wrote an experiment (I am using psychopy coder), where a stimulus contains a number of shapes for which the participant can change depth order, position and orientation.

I want to save these not only as a datafile (no problem here, works fine) but want to save the whole array of stimuli such that I can read it back into another experiment (e.g. as a .py file that I can import).

I tried several things: E.g. using pickle, but that doesn’t work with arrays containing objects “can’t pickle weakref objects”. I also tried to use the autogenerated pickled version of the exp (using the experiment handler “data.ExperimentHandler”), but when I load that it a) runs the experiment again (which I don’t want, I just want the stimulus array) and b) uses the original stim array, not the updated one (i.e. the one modified by the participant).

(in matlab, for example I can save a variable, for example, as a .mat file at the end of the session. I need sth equivalent for python.)

Any pointers are hugely appreciated!

To give you an idea of what my stim list looks like here an excerpt:
(…)
brs_3 = visual.ShapeStim(
win=mywin, name=0, vertices=[(-.352, -.0521),(-.347,.0521),(.342, .0521),(.342, -.0521)],
size=(1.25, 1.27),
ori=-25.0, pos=(-.075, -.196),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=[-0.4745, -0.9765, -0.8196], fillColor=[-0.4745, -0.9765, -0.8196],
opacity=1.0, depth=0, interpolate=True)
shape3.append(brs_3)
ys_3 = visual.ShapeStim(
win=mywin, name=1, vertices=[(-.388, -.0985),(-.388,.0985),(.388, .0985),(.388, -.0985)],
size=(1.25, 1.25),
ori=-25.5, pos=(.042, .052),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=[0.4745, 0.1451, -1.0000], fillColor=[0.4745, 0.1451, -1.0000],
opacity=1.0, depth=1, interpolate=True)
shape3.append(ys_3)
bs_3 = visual.ShapeStim(
win=mywin, name=2, vertices=[(-.13, -.13),(-.1167,.1246),(.148,.138),(.1249, -.13)],
size=(1.25, 1.25),
ori=-1.5, pos=(.016, .184),
lineWidth=1.0, colorSpace=‘rgb’, lineColor=[-1,-1,-1], fillColor=[-1,-1,-1],
opacity=1.0, depth=2, interpolate=True)
shape3.append(bs_3)
stim.append(shape3)
(… stim contains 10 shapes, where each shape contains multiple visual.ShapeStim )