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
Currently the benchmark case demonstrating global import dependency involves in circular dependency, which makes the case too ambiguous and confusing.
Given that case, python module_a.py will work fine, however python module_b.py will throw the following error:
Traceback (most recent call last):
File "...\module_b.py", line 1, in <module>
from module_a import func as f, x as x_b, ClassA as c
File "...\module_a.py", line 1, in <module>
import module_b
File "...\module_b.py", line 1, in <module>
from module_a import func as f, x as x_b, ClassA as c
ImportError: cannot import name 'func' from partially initialized module 'module_a' (most likely due to a circular import) (...\module_a.py)
If you move the first line of module_a.py (import module_b) to the last, then both commands will work properly.
This is something related to circular import, and to understand this concept, I would recommend reading this SO post.
Suggestion
Separate this benchmark case into standalone cases that demonstrate regular imports and circular imports respectively.
The text was updated successfully, but these errors were encountered:
Background
Currently the benchmark case demonstrating global import dependency involves in circular dependency, which makes the case too ambiguous and confusing.
Given that case,
python module_a.py
will work fine, howeverpython module_b.py
will throw the following error:If you move the first line of
module_a.py
(import module_b) to the last, then both commands will work properly.This is something related to circular import, and to understand this concept, I would recommend reading this SO post.
Suggestion
Separate this benchmark case into standalone cases that demonstrate regular imports and circular imports respectively.
The text was updated successfully, but these errors were encountered: