mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Get rid of many apply() calls.
This commit is contained in:
parent
f389c77273
commit
68468eba63
38 changed files with 85 additions and 91 deletions
10
Lib/pydoc.py
10
Lib/pydoc.py
|
@ -266,10 +266,10 @@ class Doc:
|
|||
def document(self, object, name=None, *args):
|
||||
"""Generate documentation for an object."""
|
||||
args = (object, name) + args
|
||||
if inspect.ismodule(object): return apply(self.docmodule, args)
|
||||
if inspect.isclass(object): return apply(self.docclass, args)
|
||||
if inspect.isroutine(object): return apply(self.docroutine, args)
|
||||
return apply(self.docother, args)
|
||||
if inspect.ismodule(object): return self.docmodule(*args)
|
||||
if inspect.isclass(object): return self.docclass(*args)
|
||||
if inspect.isroutine(object): returnself.docroutine(*args)
|
||||
return self.docother(*args)
|
||||
|
||||
def fail(self, object, name=None, *args):
|
||||
"""Raise an exception for unimplemented types."""
|
||||
|
@ -379,7 +379,7 @@ TT { font-family: lucidatypewriter, lucida console, courier }
|
|||
def bigsection(self, title, *args):
|
||||
"""Format a section with a big heading."""
|
||||
title = '<big><strong>%s</strong></big>' % title
|
||||
return apply(self.section, (title,) + args)
|
||||
return self.section(title, *args)
|
||||
|
||||
def preformat(self, text):
|
||||
"""Format literal preformatted text."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue