def format_args(self): argspec = self.args_on_obj(self.object) if argspec is None: return None args = sage_formatargspec(*argspec) # escape backslashes for reST args = args.replace('\\', '\\\\') return args
def format_args(self): # for classes, the relevant signature is the __init__ method's initmeth = self.get_attr(self.object, '__init__', None) # classes without __init__ method, default __init__ or # __init__ written in C? if initmeth is None or initmeth is object.__init__ or not \ (inspect.ismethod(initmeth) or inspect.isfunction(initmeth)): return None argspec = sage_getargspec(initmeth) if argspec[0] and argspec[0][0] in ('cls', 'self'): del argspec[0][0] return sage_formatargspec(*argspec)
def format_args(self): argspec = self.args_on_obj(self.object) if argspec is None: return None return sage_formatargspec(*argspec)