Eli Bendersky added the comment:

Thank you for the input Stefan. I was actually glancing at _decimal as an 
example of implementing pickling and inter-compatibility between the C and Py 
versions of pickles.

You've chosen compatibility by having the same class name and __reduce__ 
returning the exact same tuple for both implementation. This is a pretty good 
idea.

Unfortunately, in the case of Element it's more difficult, because the existing 
Py implementation does not have __reduce__, so pickle does its thing by looking 
at __dict__. Changing the Py version to have a __reduce__ seems risky as it may 
break compatibility between the different Py versions of Element (say, from 
3.2) and this is bad.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16076>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to