Feature Request : Autocomplete and docstring working when instantiating using class directly
- Dominant language
- Python
- Stars
- 16.8k
- Forks
- 4.5k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 6
Description
Refer to the reproducer and gif below.
```
class Foo:
def __init__(self):
self.name = "My name"
def get_name(self):
'''
This is a sample doctring
'''
print(self.name)
```

As shown, both autocomplete and docstring features are working when we instantiate an object first. However, they stop working correctly when we instantiate using class directly.
Some further points :-
- In tab-completion, the intention is not to execute code so it makes sense that `Foo().` doesn't work. But in doing `Foo().get_name??`, we are executing that cell, and hence, expecting the resulting docstring.
- Alternatively, is it possible to statically determine what `Foo()` returns? In that case, we can use that result to fix both issues.
- The autocomplete issue does fix itself when `%config IPCompleter.use_jedi` is set to `True`
Contributor guide
Assessment
This issue has not been assessed yet.