summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-09-10 12:32:58 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-09-10 12:32:58 (GMT)
commitc02adca9996026c9f84a0e9079042dad27e3738a (patch)
tree7febca5c94cfc2d591fd3850adab6abc7dfa7ecc
parent7646f7ef4a727fdd9ab8460ad67d460fc2381d8e (diff)
downloadcpython-c02adca9996026c9f84a0e9079042dad27e3738a.zip
cpython-c02adca9996026c9f84a0e9079042dad27e3738a.tar.gz
cpython-c02adca9996026c9f84a0e9079042dad27e3738a.tar.bz2
Leave show_code out of __all__ and make it clear that its lack of documentation is deliberate
-rw-r--r--Lib/dis.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/dis.py b/Lib/dis.py
index 290e7ee..1f56014 100644
--- a/Lib/dis.py
+++ b/Lib/dis.py
@@ -7,7 +7,7 @@ from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
- "findlinestarts", "findlabels", "show_code"] + _opcodes_all
+ "findlinestarts", "findlabels"] + _opcodes_all
del _opcodes_all
_have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
@@ -140,6 +140,10 @@ def _format_code_info(co):
lines.append("%4d: %s" % i_n)
return "\n".join(lines)
+# show_code is deliberately undocumented and left out of __all__,
+# since it doesn't offer any real benefit over code_info() above
+# It is only retained because it already existed and was not
+# marked as private in previous versions of Python
def show_code(co):
"""Show details about a code object."""
print(code_info(co))