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

Support dynamic importing semantics #10

Open
thisrabbit opened this issue Mar 6, 2023 · 0 comments
Open

Support dynamic importing semantics #10

thisrabbit opened this issue Mar 6, 2023 · 0 comments
Assignees

Comments

@thisrabbit
Copy link
Contributor

Background

Apart from the import statement, Python spec additional supports the dynamic importing semantics, which is as the form of function calls. Though the function accepts strings as parameters, which can be runtime generated, some simple circumstances should be analyzed since it is totally feasible.

Example

# foo.py
def foo():
  pass
# bar.py
import importlib  # The necessary built-in lib importing

obj = importlib.import_module('foo')  # Function call to specific semantic

obj.foo()  # Imported object can be accessed as any regular object

Status

Currently, neither ENRE nor Understand supports extraction of this.

Notice

The previous example only demonstrates one case of the function import_module, and still more usages are listed in the official spec. While implementing this, please do perform comprehensive investigations and fulfill all benchmarks.

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