Message281280
Now pickling of the datetime.datetime objects is implemented with __reduce_ex__. __reduce__ is not defined in datetime.datetime and is inherited from datetime.date.
>>> datetime.datetime.__reduce_ex__
<method '__reduce_ex__' of 'datetime.datetime' objects>
>>> datetime.datetime.__reduce__
<method '__reduce__' of 'datetime.date' objects>
__reduce_ex__ has higher priority and is called instead of __reduce__. It is weird that __reduce_ex__ and __reduce__ are not consistent. __reduce__ should be defined as
def __reduce__(self):
return self.__reduce_ex__(2)
or just
__reduce__ = object.__reduce__
Other way is to define __reduce_ex__ instead of __reduce__ in datetime.date. |
|
Date |
User |
Action |
Args |
2016-11-20 16:10:56 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, jaraco, belopolsky |
2016-11-20 16:10:56 | serhiy.storchaka | set | messageid: <1479658256.59.0.821335963019.issue28752@psf.upfronthosting.co.za> |
2016-11-20 16:10:56 | serhiy.storchaka | link | issue28752 messages |
2016-11-20 16:10:56 | serhiy.storchaka | create | |
|