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

Control flow incorrect if imported functions have the same name #197

Open
wchresta opened this issue Mar 23, 2019 · 2 comments
Open

Control flow incorrect if imported functions have the same name #197

wchresta opened this issue Mar 23, 2019 · 2 comments

Comments

@wchresta
Copy link
Contributor

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 added a commit to wchresta/pyt that referenced this issue Mar 23, 2019
This checks imports of functions with name collisions are resolved
correctly.
wchresta added a commit to wchresta/pyt that referenced this issue Mar 23, 2019
This checks imports of functions with name collisions are resolved
correctly.
@KevinHock
Copy link
Collaborator

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

@wchresta
Copy link
Contributor Author

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

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

No branches or pull requests

2 participants