Array of objects lost in unpickling

Bahadir bilgehan.balban at
Sun Sep 13 16:19:38 CEST 2009


I have a class:

class second:
    a = None
    b = None

class first:
    array = []

I populate the array in first class with instances of second, then
save by:

shelve =,
shelve["first"] = myfirst

When I reopen the shelve from another script, the first class is
there, but array has no elements. If I reopen the shelve in the same
script right after shelve.close(), the elements are there.

Also there are no errors printed out.

Any idea why the array of instances are lost?



More information about the Python-list mailing list