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
Is your change request related to a problem? Please describe.
We currently load modules in breadth-first order. That means we can rarely compute class inheritance correctly while loading (typically in extensions, which can trigger such computations). This triggers a whole class of issues, just see #340.
Describe the solution you'd like
Maybe we should try and load in the order of imports, so that inheritance can always be computed correctly, even when the whole module is not yet completely loaded.
We would not follow type-guarded imports.
We would still have to load the remaining modules that aren't imported by anyone, by iterating on the file list (current behavior).
Describe alternatives you've considered
Adding documentation warnings, but the API would still be very error prone -> users confused.
Additional context
A following import mechanism would also allow us to refactor how we "preload" modules. We could accept an "allowlist" in Griffe like resolve_external=["pydantic"], which we could use to decide to follow external imports or not.
The text was updated successfully, but these errors were encountered:
Is your change request related to a problem? Please describe.
We currently load modules in breadth-first order. That means we can rarely compute class inheritance correctly while loading (typically in extensions, which can trigger such computations). This triggers a whole class of issues, just see #340.
Describe the solution you'd like
Maybe we should try and load in the order of imports, so that inheritance can always be computed correctly, even when the whole module is not yet completely loaded.
We would not follow type-guarded imports.
We would still have to load the remaining modules that aren't imported by anyone, by iterating on the file list (current behavior).
Describe alternatives you've considered
Adding documentation warnings, but the API would still be very error prone -> users confused.
Additional context
A following import mechanism would also allow us to refactor how we "preload" modules. We could accept an "allowlist" in Griffe like
resolve_external=["pydantic"]
, which we could use to decide to follow external imports or not.The text was updated successfully, but these errors were encountered: