Issue36068
Created on 2019-02-21 18:44 by llllllllll, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 11981 | merged | llllllllll, 2019-02-21 18:46 | |
| Messages (4) | |||
|---|---|---|---|
| msg336251 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2019-02-21 18:44 | |
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. |
|||
| msg336258 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2019-02-21 20:59 | |
Thanks for noticing this. We really should have stuck with the original plan of subclassing property(). |
|||
| msg336259 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2019-02-21 21:00 | |
New changeset f36f89257b30e0bf88e8aaff6da14a9a96f57b9e by Raymond Hettinger (Joe Jevnik) in branch 'master': bpo-36068: Make _tuplegetter objects serializable (GH-11981) https://github.com/python/cpython/commit/f36f89257b30e0bf88e8aaff6da14a9a96f57b9e |
|||
| msg336260 - (view) | Author: Joe Jevnik (llllllllll) * | Date: 2019-02-21 21:11 | |
Thank you for reviewing this so quickly! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:11 | admin | set | github: 80249 |
| 2019-02-21 21:11:29 | llllllllll | set | messages: + msg336260 |
| 2019-02-21 21:01:12 | rhettinger | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2019-02-21 21:00:43 | rhettinger | set | messages: + msg336259 |
| 2019-02-21 20:59:55 | rhettinger | set | assignee: rhettinger messages: + msg336258 |
| 2019-02-21 18:51:10 | xtreak | set | nosy:
+ rhettinger |
| 2019-02-21 18:46:07 | llllllllll | set | keywords:
+ patch stage: patch review pull_requests: + pull_request12006 |
| 2019-02-21 18:44:13 | llllllllll | create | |
