homepage

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 ncoghlan
Recipients alexandre.vassalotti, michael.foord, ncoghlan, pitrou
Date 2012年04月14日.11:48:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334404139.5.0.0525689308052.issue14577@psf.upfronthosting.co.za>
In-reply-to
Content
Some additional thoughts for anyone else that comes across this issue.
Consider the case of a weakref proxy (the only proxy type in the stdlib): for that, you never want to serialise the proxy, you want to serialise the original object.
To correctly serialise a proxy object, you have to somehow ensure:
- the proxy gets serialised
- the target gets serialised
- the two get hooked up again at the far end
Now consider what happens if you have *two* proxies both pointing at the same target: how do you ensure that, when deserialised, both proxies still share a target?
In the general case, you can't - so pickle doesn't even try. Instead, serialising a proxy serialises the original object - if you want to do something else, you need to decide for yourself how to recreate the cross-references correctly on deserialisation.
History
Date User Action Args
2012年04月14日 11:48:59ncoghlansetrecipients: + ncoghlan, pitrou, alexandre.vassalotti, michael.foord
2012年04月14日 11:48:59ncoghlansetmessageid: <1334404139.5.0.0525689308052.issue14577@psf.upfronthosting.co.za>
2012年04月14日 11:48:58ncoghlanlinkissue14577 messages
2012年04月14日 11:48:58ncoghlancreate

AltStyle によって変換されたページ (->オリジナル) /