pickling, saving and loading

12 views
Skip to first unread message

Gordon

unread,
May 20, 2013, 4:30:45 AM5/20/13
to sage-m...@googlegroups.com
Once the user has loaded up the matroids9 array, they may want to save it for future usage.

By experimenting I have discovered that

save(matroids9, "matroids9")

and then

matroids9 = load("matroids9.sobj")

will successfully save and reload the object.


However when I search for "save objects in Python", then I get a mountain of pages about pickling and using pickle.dump() etc.

Is pickling being automagically done for me by the Matroid class?

Gordon

Stefan van Zwam

unread,
May 20, 2013, 8:11:11 AM5/20/13
to sage-m...@googlegroups.com
Hi Gordon,

Is pickling being automagically done for me by the Matroid class?

It's being done automagically by the subclasses (like BasisMatroid), in particular in the "__reduce__" method. You're welcome ;)

Cheers,


Stefan
Reply all
Reply to author
Forward
0 new messages