Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cef5b3d

Browse files
committed
Remove duplicated code in pydoc.py, probably a merge conflict some months ago.
Spotted by Humberto Diogenes.
1 parent e41251e commit cef5b3d

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

Lib/pydoc.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,23 +1500,6 @@ def render_doc(thing, title='Python Library Documentation: %s', forceload=0):
15001500
def doc(thing, title='Python Library Documentation: %s', forceload=0):
15011501
"""Display text documentation, given an object or a path to an object."""
15021502
try:
1503-
object, name = resolve(thing, forceload)
1504-
desc = describe(object)
1505-
module = inspect.getmodule(object)
1506-
if name and '.' in name:
1507-
desc += ' in ' + name[:name.rfind('.')]
1508-
elif module and module is not object:
1509-
desc += ' in module ' + module.__name__
1510-
elif not (inspect.ismodule(object) or
1511-
inspect.isclass(object) or
1512-
inspect.isroutine(object) or
1513-
inspect.isgetsetdescriptor(object) or
1514-
inspect.ismemberdescriptor(object) or
1515-
isinstance(object, property)):
1516-
# If the passed object is a piece of data or an instance,
1517-
# document its available methods instead of its value.
1518-
object = type(object)
1519-
desc += ' object'
15201503
pager(render_doc(thing, title, forceload))
15211504
except (ImportError, ErrorDuringImport) as value:
15221505
print(value)

0 commit comments

Comments
 (0)