[Python-3000-checkins] r62505 - python/branches/py3k/Lib/pydoc.py

amaury.forgeotdarc python-3000-checkins at python.org
Fri Apr 25 22:47:52 CEST 2008


Author: amaury.forgeotdarc
Date: Fri Apr 25 22:47:52 2008
New Revision: 62505

Log:
Remove duplicated code in pydoc.py, probably a merge conflict some months ago.

Spotted by Humberto Diogenes.


Modified:
   python/branches/py3k/Lib/pydoc.py

Modified: python/branches/py3k/Lib/pydoc.py
==============================================================================
--- python/branches/py3k/Lib/pydoc.py	(original)
+++ python/branches/py3k/Lib/pydoc.py	Fri Apr 25 22:47:52 2008
@@ -1500,23 +1500,6 @@
 def doc(thing, title='Python Library Documentation: %s', forceload=0):
     """Display text documentation, given an object or a path to an object."""
     try:
-        object, name = resolve(thing, forceload)
-        desc = describe(object)
-        module = inspect.getmodule(object)
-        if name and '.' in name:
-            desc += ' in ' + name[:name.rfind('.')]
-        elif module and module is not object:
-            desc += ' in module ' + module.__name__
-        elif not (inspect.ismodule(object) or
-                  inspect.isclass(object) or
-                  inspect.isroutine(object) or
-                  inspect.isgetsetdescriptor(object) or
-                  inspect.ismemberdescriptor(object) or
-                  isinstance(object, property)):
-            # If the passed object is a piece of data or an instance,
-            # document its available methods instead of its value.
-            object = type(object)
-            desc += ' object'
         pager(render_doc(thing, title, forceload))
     except (ImportError, ErrorDuringImport) as value:
         print(value)


More information about the Python-3000-checkins mailing list