[issue28752] datetime object fails to restore from reduction

Serhiy Storchaka report at bugs.python.org
Sun Nov 20 12:34:51 EST 2016


Serhiy Storchaka added the comment:

> Other way is to define __reduce_ex__ instead of __reduce__ in datetime.date.

Sorry, I was wrong. This would wouldn't work with C implementation. And explicitly setting __reduce__ = object.__reduce__ doesn't work. The only way is to define both __reduce_ex__ and __reduce__ for time and datewtime.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28752>
_______________________________________


More information about the Python-bugs-list mailing list