msg108807 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-06-27 23:12 |
Attached patch makes python -m pickletools print symbolic disassembly of a pickle to stdout. If the idea is well received, I will add help option, usage string and possibly -o option to redirect output to a file. I am not sure that current "run doctest" behavior is worth preserving given that one can always do python -m doctest Lib/pickletools.py instead. |
|
|
msg108858 - (view) |
Author: Alexandre Vassalotti (alexandre.vassalotti) *  |
Date: 2010-06-28 20:28 |
Good idea! You can remove the doctest behavior. I don't think it is useful. But if you remove it, make sure you add an usage message when no argument is given. |
|
|
msg108878 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-06-28 23:14 |
Well, assuming you want to make it useful, I'd make that behaviour depend on a command-line option, such that other actions can be added later. |
|
|
msg108884 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-06-29 01:01 |
> Well, assuming you want to make it useful, I'd make that > behaviour depend on a command-line option, .. OK, Antoine, you asked for it. :-) .diff |
|
|
msg109189 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-07-03 19:18 |
I would like to commit this. Any objections? Changes only affect running pickletools as __main__. Does this need to be documented in pickletools.rst? I noticed that dis.rst does not describe running dis.py from command line. Similarly, I cannot find tests for any module's command line behavior to base -m pickletools testing on. |
|
|
msg109190 - (view) |
Author: Antoine Pitrou (pitrou) *  |
Date: 2010-07-03 20:03 |
In 'run self-test suit', I suppose you mean 'suite'. Otherwise, looks ok. |
|
|
msg109191 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-07-03 20:38 |
Committed in r82514. I don't think this appropriate for 3.1, but will not block it yet if someone thinks it should be merged. |
|
|
msg109415 - (view) |
Author: Alexander Belopolsky (belopolsky) *  |
Date: 2010-07-06 18:31 |
On the second thought, this is clearly not a bug fix. Not a backport candidate. |
|
|