Issue 9268: Document annotation option to pickletools.dis (original) (raw)

Created on 2010-07-15 19:37 by belopolsky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pickletools-annotate.diff belopolsky,2010-07-15 19:37 Patch for py3k branch, revision 82911. review
Messages (7)
msg110388 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-15 19:37
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.
msg110467 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-07-16 18:17
Perhaps the annotations should be wrapped at 78 chars/line, for improved readability?
msg110469 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-16 18:34
> Perhaps the annotations should be wrapped at 78 chars/line .. I don't know. With deeply nested pickles, annotations may not even start before column 80. I think further improvement in alignment and layout algorithms will show diminishing returns. If I were to invest an effort into this, I would share it with dis.dis. You can see how larger pickles look by running pickletools -a 27.bench with a pickle from .
msg110542 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2010-07-17 08:11
LGTM
msg110568 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-17 15:56
Committed in r82931 with small changes based on comments here and on IRC: 1. Annotations are separated from disassembly by spaces without '|'. 2. Made a small improvement to the annotation alignment algorithm. Excessively long lines do not force the rest of the annotations off the screen. 3. Added ReST documentation for the new dis() argument. The command line behavior is still undocumented. I am watching python-dev discussion on how it should be presented in ReST.
msg111648 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2010-07-26 17:23
Reopening as a documentation issue: - manual entry should have a versionchanged - use *arg* instead of 'arg' - add a ReST entry describing -m pickletools
msg126203 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-13 22:00
Committed documentation changes in revision 87990.
History
Date User Action Args
2022-04-11 14:57:03 admin set github: 53514
2011-01-13 22:00:03 belopolsky set status: open -> closednosy:lemburg, mark.dickinson, belopolsky, pitrou, alexandre.vassalotti, ezio.melottimessages: + resolution: fixedstage: needs patch -> resolved
2010-12-01 18:40:45 belopolsky set title: Add annotation option to pickletools.dis -> Document annotation option to pickletools.disresolution: fixed -> (no value)stage: resolved -> needs patch
2010-07-26 17:23:28 belopolsky set status: closed -> opennosy: + ezio.melottimessages: + components: + Documentation
2010-07-17 16:02:27 belopolsky set status: open -> closedresolution: fixedstage: test needed -> resolved
2010-07-17 15:56:02 belopolsky set messages: +
2010-07-17 08:11:45 alexandre.vassalotti set messages: +
2010-07-16 18:34:34 belopolsky set messages: +
2010-07-16 18:17:58 pitrou set messages: +
2010-07-15 19:37:15 belopolsky create