pyt icon indicating copy to clipboard operation
pyt copied to clipboard

Control flow incorrect if imported functions have the same name

Open wchresta opened this issue 6 years ago • 2 comments

When there are two modules that expose a function with the same name, and those get imported directly (using aliases), the control flow is resolved incorrectly.

Example: module_a.py

def foo():
    return 'module_a.foo'

module_b.py

def foo():
    return 'module_b.foo'

test.py

from module_a import foo as foo_a
from module_b import foo as foo_b

foo_a()
foo_b()

This will lead to a control flow that calls the function module_a.foo twice instead of once for each version.

wchresta avatar Mar 23 '19 18:03 wchresta

Just read your code that fixes this, it is awesome :)

KevinHock avatar Mar 23 '19 19:03 KevinHock

@KevinHock sadly I was so far unable to fix this for the moment. I'll try to look into this after #177 and #180.

wchresta avatar Mar 23 '19 20:03 wchresta