Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Seems to me that the ducked-typed nature of Python makes it pretty much impossible to determine this information in a text editor.

    class A(object): def read(): return 'A'

    class B(object): def read(): return 'B'

    def doit(i):
        if i==1: obj = A()
        else: obj = B()
        return obj.read()
When you put your cursor over the .read() in obj.read(), where does it point to?


You're not thinking big enough. Imagine a rewinding debugger that records a complete execution of your program. Then whenever your cursor moves, the debugger could step to a point when that line of code was executing and give you autocomplete suggestions based on the state of the program at that time.


Doesn't solve the problem.

The same function can get called a 1000 times and take different paths each time. Which method is your hypothetical rewinding debugger going to show? (Leaving aside the big gaping hole of how your program is executing while you are typing it out).

The problem of deciding which method actually gets called by static analysis in a text editor (and it would have to be static analysis) is literally impossible for dynamic languages - pretty much by definition.


You are far too pessimistic; a few very simple heuristics would work great in most cases. It doesn't have to be perfect. Something imperfect would be miles better than nothing, which is what we have now for dynamic languages.


how about just a popup box that lets you choose where you would like to go?

I see this type of situation as something that shouldn't happen very frequently.

Also, you could take this one step further and have it split screen the methods in multiple files if you like.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: