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.

classification
Title: Add an updating load function in pickle
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.1, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: belopolsky Nosy List: ajaksu2, belopolsky, nidoizo
Priority: normal Keywords:

Created on 2004-05-26 13:34 by nidoizo, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg61167 - (view) Author: Nicolas Fleury (nidoizo) Date: 2004-05-26 13:34
It would be very nice to have a function in pickle to
load an object without creating a new instance, but by
using an existing one, meaning that __init__, etc. of
an existing instance is called.

Something like:
updateload(object, file)

(I have no patch in mind.)
msg61168 - (view) Author: Nicolas Fleury (nidoizo) Date: 2004-05-27 13:04
Logged In: YES 
user_id=151545

I realize it might not be clear.  What is needed is simply a
function that does the same as pickle.load but that uses an
existing instance instead of creating another one.  All the
rest after that point is the same.  It means this function
would raise an exception if the instance is not of the good
type, etc.  (Forget the part about __init__).
msg81439 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-02-09 06:14
Any real use cases beyond being very nice?
msg108890 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-06-29 02:55
This functionality already exists.  

"""
If a string is returned [from __reduce__() method], the string should be interpreted as the name of a global variable. It should be the object’s local name relative to its module; the pickle module searches the module namespace to determine the object’s module. This behaviour is typically useful for singletons.
""" -- http://docs.python.org/dev/py3k/library/pickle.html
msg109207 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-04 04:42
On the second reading, OP's request has nothing to do with pickle.load().  In fact, there is no coherent request here.
History
Date User Action Args
2022-04-11 14:56:04adminsetgithub: 40292
2010-07-04 04:42:54belopolskysetstatus: pending -> closed

messages: + msg109207
2010-06-29 02:55:28belopolskysetstatus: open -> pending

nosy: + belopolsky
messages: + msg108890

assignee: belopolsky
resolution: not a bug
2009-02-09 06:14:00ajaksu2setnosy: + ajaksu2
messages: + msg81439
versions: + Python 3.1, Python 2.7
2004-05-26 13:34:50nidoizocreate