summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2013-09-22 12:46:49 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2013-09-22 12:46:49 (GMT)
commitf94a16b494a2b21b8fcb90d666a31f6d78cabc26 (patch)
tree6c57e1aa09150175d484a45ae8351f0692cd04b3 /Doc
parent4c7fe6a5add2d773ae3a85679d22414d8eafe66c (diff)
downloadcpython-f94a16b494a2b21b8fcb90d666a31f6d78cabc26.zip
cpython-f94a16b494a2b21b8fcb90d666a31f6d78cabc26.tar.gz
cpython-f94a16b494a2b21b8fcb90d666a31f6d78cabc26.tar.bz2
Close #18626: add a basic CLI for the inspect module
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst17
-rw-r--r--Doc/whatsnew/3.4.rst6
2 files changed, 22 insertions, 1 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index aabf85d..40e0158 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -1006,3 +1006,20 @@ updated as expected:
return an empty dictionary.
.. versionadded:: 3.3
+
+
+Command Line Interface
+----------------------
+
+The :mod:`inspect` module also provides a basic introspection capability
+from the command line.
+
+.. program:: inspect
+
+By default, accepts the name of a module and prints the source of that
+module. A class or function within the module can be printed instead by
+appended a colon and the qualified name of the target object.
+
+.. cmdoption:: --details
+
+ Print information about the specified object rather than the source code
diff --git a/Doc/whatsnew/3.4.rst b/Doc/whatsnew/3.4.rst
index 60dd94d..0690e70 100644
--- a/Doc/whatsnew/3.4.rst
+++ b/Doc/whatsnew/3.4.rst
@@ -264,11 +264,15 @@ New :func:`functools.singledispatch` decorator: see the :pep:`443`.
inspect
-------
+
+The inspect module now offers a basic command line interface to quickly
+display source code and other information for modules, classes and
+functions.
+
:func:`~inspect.unwrap` makes it easy to unravel wrapper function chains
created by :func:`functools.wraps` (and any other API that sets the
``__wrapped__`` attribute on a wrapper function).
-
mmap
----