[issue18626] Make "python -m inspect <name>" meaningful

Nick Coghlan report at bugs.python.org
Sat Aug 17 16:53:53 CEST 2013


Nick Coghlan added the comment:

I realised that with the "module:qualname" syntax, it's straightforward to expand this beyond module introspection to arbitrary objects.

What I suggest we could output:

- a header with key module info (names taken from PEP 451):
    Origin
    Cached
    Submodule search path
    Loader (repr output)

- for non-module objects, also include the line within the file (if it can be determined)

- the output of getsource() if a "--source" option is given

----------
title: Make "python -m inspect <name>" dump the source of a module -> Make "python -m inspect <name>" meaningful

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18626>
_______________________________________


More information about the Python-bugs-list mailing list