Get rid of many apply() calls.

This commit is contained in:
Guido van Rossum 2003-02-27 20:14:51 +00:00
parent f389c77273
commit 68468eba63
38 changed files with 85 additions and 91 deletions

View file

@ -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."""