I am trying to figure out what instance variables do not show up in auto completion in an IPython or Jupyter notebook. For example, if I have the class below:
class A:
def __init__(self, var_a: int):
self.var_a = var_a
and I define a class B
that takes an instance of A
at initialization, it seems like autocompletion does not look through to the definition of class A
to see that it has a var_a
instance attribute.
class B:
def __init__(self, var_b: A):
self.var_b = var_b
def func(self):
self.var_b.
I do not get any type hints if I press tab after the last period in the snippet above. Pylance (through the VS Code Python extension) and PyCharm both show autocompletion for self.var_b.var_a
. Is there a way to configure either IPython or the code annotations so that autocompletion will also work in IPython?
Using IPython 8.4.0
Tried %config Completer.use_jedi = True
in the first notebook cell which did not help.