◐ Shell
clean mode source ↗

Message 209378 - Python tracker

>>> import inspect
>>> class C:
	def meth(*args): pass
	
>>> str(inspect.signature(C.meth))
'(*args)'
>>> c=C()
>>> str(s=inspect.signature(c.meth))
'()'

*args should have been left in even for the bound method, as idlelib calltips do.
Since '*' is not a word character,
idlelib.Calltips._first_param = re.compile('(?<=\()\w*\,?\s*')
does not see '*args' as a substring to be deleted with
    argspec = _first_param.sub("", argspec)

The same comment applies to
    def meth2(**kwds): pass
even though calling the bound method would fail.