-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Question] Circular imports and "deferred" #170
Comments
As much I don't really want to encourage people using circular imports I believe you're correct in narrowing down the underlying issue and this seems like a sensible change, I'll happily accept a PR implementing this as long as there's a test provided (will require a test package with a circular import to replicate the situation). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an issue with circular imports that I am having trouble resolving.
Here is a simple repro case which is similar to what I am doing:
When I run this, I get an
AttributeError
related to circular imports caused by a call toget_type_hints
. I hoped this would defer, due to the use of a forward reference inc.py
and module imports, but maybe I am misunderstanding?Since I don't have a full understanding of
Injector
internals, I tried a longshot of addingAttributeError
to the try/except (in addition toNameError
that's already caught) in_infer_injected_bindings
at line 1164. This actually works for both the simplified repro and my actual application. However, I don't know what other implications this change might have and I wanted to seek you advice.Thanks!
The text was updated successfully, but these errors were encountered: