[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2018-07-05 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 18, 2016, at 8:49 AM, Serhiy Storchaka wrote: > > But there are two drawbacks. It is not too late to make improvements. If you have specific proposals - please bring them up on the mailing list. --

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your explanation Alexander. It looks reasonable. But there are two drawbacks. 1. By default the fold bit is ignored. That means that you lost it when use multiprocessing or other library that uses default pickle protocol. 2. It is not easy to

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > On Nov 18, 2016, at 7:04 AM, Serhiy Storchaka wrote: > > Yet one doubtful detail is that the fold bit is added to the hour bit in > datetime.time, but to the month field in datetime.datetime. The reason behind this choice is

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It seems to me that this is not documented. I'm even not sure that this change is compatible. Additional bit is saved only with protocol 4. The default protocol is 3, thus your should explicitly specify it. But protocol 4 is supported since 3.4. It seems to

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-18 Thread Jeff Reback
Jeff Reback added the comment: ok thanks for the info. fixed in pandas here: https://github.com/pandas-dev/pandas/pull/14689 is this documented in the whatsnew? -- ___ Python tracker

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: That is because some datetime classes now define __reduce_ex__ instead of __reduce__ (see issue24773). It has higher priority. -- nosy: +belopolsky, serhiy.storchaka ___ Python tracker

[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Jeff Reback
New submission from Jeff Reback: xref to https://github.com/pandas-dev/pandas/issues/14679. pandas has had a cython extension class to datetime.datetime for quite some time. A simple __reduce__ is defined. def __reduce__(self): object_state = self.value, self.freq, self.tzinfo