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 michael.foord
Recipients alexandre.vassalotti, michael.foord, ncoghlan, pitrou
Date 2012-04-14.11:52:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334404378.98.0.831734072894.issue14577@psf.upfronthosting.co.za>
In-reply-to
Content
Nick - in general proxy objects have a *reference* to their target (weakref being somewhat of a special case), and pickle can already handle multiple references to the same target when deserializing an object graph. So I don't see that argument holding water for the general case.

I also challenge the assertion that for a weakref proxy "you never want to serialise the proxy, you want to serialise the original object". Why? If the weakref proxy could be serialized and deserialized including the target, why would you *not* want a weakref proxy back (on its own there isn't much use for that but as part of an object graph having serialization turn a weakref into a strong reference sounds like an anti-feature).

However, it looks like implementing __reduce__ is sufficient for my use case. Although the special-method-lookup-on-instance is still a nuisance.
History
Date User Action Args
2012-04-14 11:52:59michael.foordsetrecipients: + michael.foord, ncoghlan, pitrou, alexandre.vassalotti
2012-04-14 11:52:58michael.foordsetmessageid: <1334404378.98.0.831734072894.issue14577@psf.upfronthosting.co.za>
2012-04-14 11:52:58michael.foordlinkissue14577 messages
2012-04-14 11:52:58michael.foordcreate