Pickling problematic with Python 2 #311
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
When Danny started the NDB port, he was fond of using
__slots__
, since classes which use them have better performance than classes which rely on adict
for class attributes. However, as I just learned today,pickle
doesn't support classes with__slots__
under Python 2, so you can get errors when trying to pickle an NDB entity under Python 2. (I'm not sure pickling is the best way to serialize NDB entities, but at least some users do this, for better or for worse.)When attempting to pickle a class with slots, you get the following error:
A test which exposes one such error is in
tests.system.test_misc.test_pickle_roundtrip_structured_property
(added in #312).The text was updated successfully, but these errors were encountered: