That’s indeed the current behavior, i.e. overriding the default __init__ signature disables the automatic setting of the __signature__ class attribute that is leveraged by IPython for autocompletion:
For classes with a constructor signature that matches the default
Parameterized.__init__ signature (i.e. ``__init__(self, **params)``)
this method will generate a new signature that expands the
parameters. If the signature differs from the default the
custom signature is returned.
"""
if mcs._param__private.signature:
return mcs._param__private.signature
# allowed_signature must be the signature of Parameterized.__init__
# Inspecting `mcs.__init__` instead of `mcs` to avoid a recursion error
if inspect.signature(mcs.__init__) != DEFAULT_SIGNATURE:
return None
processed_kws, keyword_groups = set(), []
for cls in reversed(mcs.mro()):
keyword_group = []
for k, v in sorted(cls.__dict__.items()):
if isinstance(v, Parameter) and k not in processed_kws and not v.readonly:
keyword_group.append(k)
processed_kws.add(k)
keyword_groups.append(keyword_group)
That’s a conservative approach that I guess could be improved. Can you open an issue?