You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does jedi support wild card import and unto what extent?
I've been using this library to analyze a Python project and extract symbol definitions and references. But I've encountered an issue when dealing with wildcard imports (import *).
Example:
Consider the following code structure:
# utils.py
def check_files_in_directory():
pass
# main.py
from utils import *
def main():
check_files_in_directory()
When I try to resolve the check_files_in_directory function in main.py, it fails to determine its origin due to the wildcard import.
What I've tried:
I've successfully resolved symbols for explicit imports, e.g., from utils import check_files_in_directory.
Question:
Is there a way to make jedi resolve symbols imported with wildcard imports effectively? I understand wildcard imports can be challenging for static analysis tools since they obfuscate the origin of symbols. **Do I have to set some configuration? For my case, even if it the analysis takes time and it is slow to resolve it, that is not a problem.
The text was updated successfully, but these errors were encountered:
code2graph
changed the title
Support for wild card import
Resolving Python Symbols with Wildcard Imports
Aug 18, 2023
This kind of stuff is well supported within Jedi. It even works in places like numpy that does nested star imports. I feel like you have either an outdated Jedi version or you are not using Jedi (accidentally) or most likely there's an issue with your sys path or the sys path you provide to Jedi.
If you want me to help, you have to write a full reproduction with a zip archive that I could look at.
Also note that this is a feature we have had zero complaints about for probably 7+ years. It is also automatically tested.
Does jedi support wild card import and unto what extent?
I've been using this library to analyze a Python project and extract symbol definitions and references. But I've encountered an issue when dealing with wildcard imports (
import *
).Example:
Consider the following code structure:
When I try to resolve the
check_files_in_directory
function inmain.py
, it fails to determine its origin due to the wildcard import.What I've tried:
I've successfully resolved symbols for explicit imports, e.g.,
from utils import check_files_in_directory
.Question:
Is there a way to make
jedi
resolve symbols imported with wildcard imports effectively? I understand wildcard imports can be challenging for static analysis tools since they obfuscate the origin of symbols. **Do I have to set some configuration? For my case, even if it the analysis takes time and it is slow to resolve it, that is not a problem.The text was updated successfully, but these errors were encountered: