New submission from Alexander Belopolsky <belopol...@users.sourceforge.net>:

Example:

>>> dis(pickle.dumps(T, 3), annotate=1)                                         
>>>                                                                             
>>>                     
    0: \x80 PROTO      3 | Protocol version indicator.                          
                                                                                
                
    2: ]    EMPTY_LIST   | Push an empty list.                                  
                                                                                
                
    3: q    BINPUT     0 | Store the stack top into the memo.  The stack is not 
popped.                                                                         
                
    5: h    BINGET     0 | Read an object from the memo and push it on the 
stack.                                                                          
                     
    7: \x85 TUPLE1       | One-tuple.                                           
                                                                                
                
    8: q    BINPUT     1 | Store the stack top into the memo.  The stack is not 
popped.                                                                         
                
   10: a    APPEND       | Append an object to a list.                          
                                                                                
                
   11: 0    POP          | Discard the top stack item, shrinking the stack by 
one item.                                                                       
                  
   12: h    BINGET     1 | Read an object from the memo and push it on the 
stack.                                                                          
                     
   14: .    STOP         | Stop the unpickling machine.

----------
assignee: belopolsky
files: pickletools-annotate.diff
keywords: easy, patch
messages: 110388
nosy: alexandre.vassalotti, belopolsky, lemburg, mark.dickinson, pitrou
priority: normal
severity: normal
stage: unit test needed
status: open
title: Add annotation option to pickletools.dis
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file18018/pickletools-annotate.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9268>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to