Append "..." if the appropriate flag (for varargs) in co_flags is set.

Ditto "***" for kwargs.
This commit is contained in:
Guido van Rossum 1999-06-09 20:34:57 +00:00
parent d9e5d17407
commit 2073177e01
1 changed files with 3 additions and 1 deletions

View File

@ -111,8 +111,10 @@ def get_arg_text(ob):
defaults = list(map(lambda name: "=%s" % name, defaults)) defaults = list(map(lambda name: "=%s" % name, defaults))
defaults = [""] * (len(realArgs)-len(defaults)) + defaults defaults = [""] * (len(realArgs)-len(defaults)) + defaults
items = map(lambda arg, dflt: arg+dflt, realArgs, defaults) items = map(lambda arg, dflt: arg+dflt, realArgs, defaults)
if len(realArgs)+argOffset < (len(ob.func_code.co_varnames) - len(ob.func_code.co_names) ): if ob.func_code.co_flags & 0x4:
items.append("...") items.append("...")
if ob.func_code.co_flags & 0x8:
items.append("***")
argText = string.join(items , ", ") argText = string.join(items , ", ")
argText = "(%s)" % argText argText = "(%s)" % argText
except: except: