Message 336251 - Python tracker

Message336251

Author llllllllll
Recipients llllllllll
Date 2019-02-21.18:44:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550774653.56.0.094424899165.issue36068@roundup.psfhosted.org>
In-reply-to
Content
The new _tuplegetter objects for accessing fields of a namedtuple are no longer serializable with pickle. Cloudpickle, a library which provides extensions to pickle to facilitate distributed computing in Python, depended on being able to pickle the members of namedtuple classes. While property isn't serializable, cloudpickle has support for properties allowing us to serialize the old property(itemgetter) members.

The attached PR adds a __reduce__ method to _tuplegetter objects which will allow serialization without special support. Another option would be to expose `index` as a read-only attribute, allowing cloudpickle or other libraries to provide the pickle implementation as a third-party library.
History
Date User Action Args
2019-02-21 18:44:13llllllllllsetrecipients: + llllllllll
2019-02-21 18:44:13llllllllllsetmessageid: <1550774653.56.0.094424899165.issue36068@roundup.psfhosted.org>
2019-02-21 18:44:13lllllllllllinkissue36068 messages
2019-02-21 18:44:13llllllllllcreate