From 8abc94f7cb4001e1a39d7890cb239ad59ee86350 2021-02-01 16:25:00 From: Matthias Bussonnier Date: 2021-02-01 16:25:00 Subject: [PATCH] Backport PR #12255: fix getting signatures in jedi 0.17 --- diff --git a/IPython/core/completer.py b/IPython/core/completer.py index b5d5a83..77bcd44 100644 --- a/IPython/core/completer.py +++ b/IPython/core/completer.py @@ -988,6 +988,15 @@ def _make_signature(completion)-> str: """ + # it looks like this might work on jedi 0.17 + if hasattr(completion, 'get_signatures'): + signatures = completion.get_signatures() + if not signatures: + return '(?)' + + c0 = completion.get_signatures()[0] + return '('+c0.to_string().split('(', maxsplit=1)[1] + return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for signature in completion.get_signatures() for p in signature.defined_names()) if f])