This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients belopolsky, berker.peksag, bmispelon, corona10, p-ganssle, rhettinger, serhiy.storchaka, taleinat, tim.peters, vstinner
Date 2019-09-05.06:00:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 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:06taleinatsetrecipients: + taleinat, tim.peters, rhettinger, belopolsky, vstinner, berker.peksag, serhiy.storchaka, bmispelon, p-ganssle, corona10
2019-09-05 06:00:06taleinatsetmessageid: <>
2019-09-05 06:00:06taleinatlinkissue24416 messages
2019-09-05 06:00:05taleinatcreate