namlook/mongokit — pull request #142 by petersng (2013-08-29 02:42:30+00:00)
Title: Added __getstate__ and __setstate__ to DotedDict and i18nDotedDict.

Noticed that I was receiving a Python error:
...
dict = getstate()
TypeError: 'NoneType' object is not callable
...

when trying to cPickle.dumps a MongoKit document. I noticed that occurred because a field in my doc was treated as a mongokit.helpers.DotedDict rather than a normal dict. It appears that without explicitly stating \_\_getstate__ and \_\_setstate__ as a normal dict, the pickling fails. I have added these functions. Never know when you need to pickle these objects.