View Single Post
Old 05-03-2010, 11:22 AM   #5
ArchPrime
Member
 
Join Date: Aug 2008
Home MUD: Archons of Avenshar
Posts: 72
ArchPrime is on a distinguished road
Re: IslandsMUD; python code base written in 48 hours

There are no problems with using pickle for object serialization when you pickle the object's __dict__ (as IDE said). For AoA, I created a persistence mixin for objects whose dictionaries I want to pickle -- the mixin basically has 'save' and 'load' methods, along with some other class metadata that tells the base persistence class where to store the object and what to store...

As for a database, I've utilized data storage using Python's SQLITE interface for a while now, and quite frankly, storing the pickled dictionary in a column, along with desired data in other columns (IE: any object data you want as reportable/searchable; primary keys, etc) works very well. It's fast. It's easy. It just made sense.

Good Luck!
ArchPrime is offline   Reply With Quote