Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab complete for class __call__ not working #1962

Open
MarcoGorelli opened this issue Sep 30, 2023 · 1 comment
Open

Tab complete for class __call__ not working #1962

MarcoGorelli opened this issue Sep 30, 2023 · 1 comment
Labels

Comments

@MarcoGorelli
Copy link

What follows is an issue I originally reported to IPython, but was asked to report here (original issue: ipython/ipython#14184)


If I make the following two files:

# t.py
class MyClass:
    def my_method(self) -> None:
        print('this is my method')


def foo() -> MyClass: return MyClass()

and

# f.py
class MyClass:
    def my_method(self) -> None:
        print('this is my method')

class Foo:
    def __call__(self) -> MyClass:
        return MyClass()

foo = Foo()

then foo().my_method() works for both

But - I only get the auto-complete suggestion for the first one: ipython -i t.py:

Screenshot 2023-09-30 102929

ipython -i f.py:

Screenshot 2023-09-30 102832

Shouldn't both autocomplete to the method available in MyClass?

For reference, this came up here pola-rs/polars#11433

@davidhalter
Copy link
Owner

I agree that this should probably work, but it's not a normal Jedi case due to the fact that the source code is not available anymore (for Jedi). I feel like we should fix this, but at the same time I understand very well why this didn't work in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants