From e51dff0fb2ccf764378199b74c4afc2633e3248b Mon Sep 17 00:00:00 2001 From: CCLDArjun Date: Sun, 13 Jun 2021 16:11:45 -0700 Subject: [PATCH 1/2] added doc for dis module \-m --- Doc/library/dis.rst | 4 ++++ Lib/dis.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index bc206f7d2e96af..4d1ff182fbcc59 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -41,6 +41,10 @@ the following command can be used to display the disassembly of (The "2" is a line number). +c:mod:`dis` an also be invoked as a script to disassemble other scripts. For example:: + + python -m dis myscript.py + Bytecode analysis ----------------- diff --git a/Lib/dis.py b/Lib/dis.py index 48a6ab8e41df3f..2f53f4f820c1fc 100644 --- a/Lib/dis.py +++ b/Lib/dis.py @@ -566,7 +566,7 @@ def dis(self): return output.getvalue() -def _test(): +def main(): """Simple test program to disassemble a file.""" import argparse @@ -579,4 +579,4 @@ def _test(): dis(code) if __name__ == "__main__": - _test() + main() From 41b1e54e397391d6b594cb5d18746382728a7409 Mon Sep 17 00:00:00 2001 From: CCLDArjun Date: Sun, 13 Jun 2021 16:17:44 -0700 Subject: [PATCH 2/2] fixed the dis link --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 4d1ff182fbcc59..7ea2bfde9f69e5 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -41,7 +41,7 @@ the following command can be used to display the disassembly of (The "2" is a line number). -c:mod:`dis` an also be invoked as a script to disassemble other scripts. For example:: +:mod:`dis` an also be invoked as a script to disassemble other scripts. For example:: python -m dis myscript.py