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 gregory.p.smith
Recipients gregory.p.smith, richardlev, serhiy.storchaka
Date 2021-04-27.16:05:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619539529.53.0.106788815629.issue43946@roundup.psfhosted.org>
In-reply-to
Content
Thanks, that makes sense.  And it at least less ugly than the __new__ hack I was thinking of as a workaround.  though similar in spirit.

presumably self.append should get the same treatment for completeness given the PEP 307 text.

I didn't notice a place in the Python pickle docs that mentioned this specific thing about listitems and the need for append/extend.  I didn't do a thorough read though, maybe I overlooked something?  If not, it'd be worth figuring out how to get this uninitialized class calling of append/extend/__setitem__ for list and dict objects detailed in the main docs rather than off in the PEP.

It's semi-mentioned https://docs.python.org/3/library/pickle.html#object.__reduce__ here which is what the PEP added I suppose, but given this code has no custom __reduce__, we need to explicitly mention that list and dict subclasses supporting pickling/copying may need to be prepared to handle this situation.  With a versionchanged:: 3.7 noting that it now always applies to list subclasses without their own __reduce__.
History
Date User Action Args
2021-04-27 16:05:29gregory.p.smithsetrecipients: + gregory.p.smith, serhiy.storchaka, richardlev
2021-04-27 16:05:29gregory.p.smithsetmessageid: <1619539529.53.0.106788815629.issue43946@roundup.psfhosted.org>
2021-04-27 16:05:29gregory.p.smithlinkissue43946 messages
2021-04-27 16:05:29gregory.p.smithcreate