Tab completion Fraction(n,m).denomi<TAB> causes "Exception There are no params defined on this."
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 4.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 6
Description
Here is how to reproduce the problem:
```
$ ipython
Python 3.7.3 (default, Jun 11 2019, 18:15:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.5.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from fractions import Fraction as fr
In [2]: fr(2,3).denomi
```
Now, at this point press `TAB` and then the `In [2]...` line disappears and we get this:
```
Unhandled exception in event loop:
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/eventloop/coroutine.py", line 90, in step_next
new_f = coroutine.throw(exc)
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/buffer.py", line 1648, in new_coroutine
yield From(coroutine(*a, **kw))
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/eventloop/coroutine.py", line 90, in step_next
new_f = coroutine.throw(exc)
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/buffer.py", line 1500, in async_completer
cancel=lambda: not proceed()))
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/eventloop/coroutine.py", line 86, in step_next
new_f = coroutine.send(None)
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/eventloop/async_generator.py", line 114, in consume_async_generator
item = iterator.send(send)
File "/usr/local/lib/python3.7/site-packages/prompt_toolkit/completion/base.py", line 170, in get_completions_async
for item in self.get_completions(document, complete_event):
File "/usr/local/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 90, in get_completions
yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
File "/usr/local/lib/python3.7/site-packages/IPython/terminal/ptutils.py", line 100, in _get_completions
for c in completions:
File "/usr/local/lib/python3.7/site-packages/IPython/core/completer.py", line 445, in _deduplicate_completions
completions = list(completions)
File "/usr/local/lib/python3.7/site-packages/IPython/core/completer.py", line 1820, in completions
for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
File "/usr/local/lib/python3.7/site-packages/IPython/core/completer.py", line 1877, in _completions
signature = _make_signature(jm)
File "/usr/local/lib/python3.7/site-packages/IPython/core/completer.py", line 996, in _make_signature
return '(%s)'% ', '.join([f for f in (_formatparamchildren(p) for p in completion.params) if f])
File "/usr/local/lib/python3.7/site-packages/jedi/cache.py", line 143, in wrapper
result = method(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/jedi/api/classes.py", line 345, in params
raise AttributeError('There are no params defined on this.')
Exception There are no params defined on this.
Press ENTER to continue...
In [2]: fr(2,3).denomi
```
(The `ENTER` was already pressed, so the `In [2]...` line came back). You can see from the above listing that the version of Python is 3.7.3 and the version of IPython is 7.5.0.
Contributor guide
Assessment
This issue has not been assessed yet.