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.

Title: pickletools support for multiple pickles in a string
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, tim.peters
Priority: normal Keywords:

Created on 2004-01-08 15:53 by fdrake, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg60448 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-01-08 15:53
It would be nice if it were easier to "look at"
multiple pickles in a string using pickletools.  The
issue is that multiple pickles created using a single
pickler share a memo.  Some unpickler-like object would
be conventient to work with for this case.
msg60449 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-01-08 16:15
Logged In: YES 

pickletools.dis() already has an optional memo argument.  Do

mymemo = {}
dis(pickle, memo=mymemo)
dis(pickle, memo=mymemo)
dis(pickle, memo=mymemo)

(for example) to disassemble the first 3 objects in a pickle.
msg60450 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-01-08 17:10
Logged In: YES 

Yes, we found that, but it would be nice to have a more
convenient interface for it.  Note that you're example will
still just disassemble the first object 3 times it "pickle"
is a string; a fairly trivial convenience object can wrap
that with a StringIO so you actually handle subsequent
pickles when calling for a disassembly.
msg60451 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-01-08 17:14
Logged In: YES 

Well, the module is called pickletools, not 
pickleeverydamnfoolfunctionicanthinkof <wink>.  Convenience 
is for wusses, but you have my blessing if somone wants to 
msg60452 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-01-08 17:18
Logged In: YES 

There's a reason I assigned it to myself.  ;-)
msg76888 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2008-12-04 15:37
I can't remember why I wanted this; guess this should indeed go in the
pickleeverydamnfoolfunctionicanthinkof module, not the standard library.
Date User Action Args
2022-04-11 14:56:02adminsetgithub: 39787
2008-12-04 15:37:10fdrakesetstatus: open -> closed
resolution: rejected
messages: + msg76888
stage: resolved
2004-01-08 15:53:28fdrakecreate