Message351178
> Would it be possible to tell pickle to serialize .isocalendar() as a tuple, and deserialize it from a tuple to a structseq?
The former is possible but that latter is not: If the object is pickled as a tuple, it will always be unpickled as a simple tuple. To customize unpickling, the serialized data must include the name of the class to use, and that class will never exist in earlier Python versions. I don't think there's a way around this.
However, I find Raymond's note very convincing, in that we should likely not let the unpickling issue get in the way of this improvement:
> FWIW, most things in Python that return a structseq previously returned a tuple (for example, time.localtime() and sys.version_info).
>
> This is not an unprecedented upgrade to improve the repr and provide access by field name in addition to positional access. |
|
Date |
User |
Action |
Args |
2019-09-05 06:00:06 | taleinat | set | recipients:
+ taleinat, tim.peters, rhettinger, belopolsky, vstinner, berker.peksag, serhiy.storchaka, bmispelon, p-ganssle, corona10 |
2019-09-05 06:00:06 | taleinat | set | messageid: <1567663206.35.0.112372572106.issue24416@roundup.psfhosted.org> |
2019-09-05 06:00:06 | taleinat | link | issue24416 messages |
2019-09-05 06:00:05 | taleinat | create | |
|