by statictype · 14y ago · 0 comments
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?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.
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.