diff -r 0238cc842805 Lib/idlelib/CallTips.py --- a/Lib/idlelib/CallTips.py Thu Dec 06 17:49:58 2012 -0500 +++ b/Lib/idlelib/CallTips.py Fri Dec 07 11:34:19 2012 +0200 @@ -148,13 +148,13 @@ else: doc = getattr(ob, "__doc__", "") if doc: - doc = doc.lstrip() - pos = doc.find("\n") - if pos < 0 or pos > 70: - pos = 70 - if argspec: - argspec += "\n" - argspec += doc[:pos] + lines = [argspec] if argspec else [] + for line in doc.splitlines(): + line = line.strip() + if not line: + break + lines.append(line[:70]) + argspec = '\n'.join(lines) if not argspec: argspec = _default_callable_argspec return argspec @@ -211,10 +211,12 @@ def test_builtins(): # if first line of a possibly multiline compiled docstring changes, # must change corresponding test string - test('int', "int(x[, base]) -> integer") + test('int', "int(x=0) -> integer\n" + "int(x, base=10) -> integer") test('Int', Int.__doc__) test('types.MethodType', "method(function, instance)") - test('list', "list() -> new empty list") + test('list', "list() -> new empty list\n" + "list(iterable) -> new list initialized from iterable's items") test('List', List.__doc__) test('list.__new__', 'T.__new__(S, ...) -> a new object with type S, a subtype of T')