Replies: 2 comments 1 reply
|
I feel like we talked about this already and decided there was no reason we'd ever want to use this. Maybe that was only me looking at it (it did not look useful to me). did you mean using this instead of our current converting to a discussion for now since there's no actual proposal here; "add |
|
The biggest question I have with lazy imports is how they will interact with relationships in model definitions with cyclic dependencies when running introspection on If The biggest worry I have here is that the lazy import either becomes permanently broken in that module, or that half a dozen broken imports are attempted at module execution time, only to fail and later having to start over, slowing down initial load times, rather than improving them. Python tooling will almost certainly start pushing people away from |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Python 3.15 added support for lazy imports https://peps.python.org/pep-0810/
This issue would be to investigate this feature and add
__lazy_modules__were appropriate to remain compatible with older versions there is the possibility.Running under
PYTHON_LAZY_IMPORTS=allis a non-goal and would be out of scope of this issue, since it would require all "must be eager" import to useimportlib.import_module/__import__and I don't think it would make much sense.NOTE that I haven't checked if there are such modules in sqlalchemy, but I expect there would be since at least some of the feature rely on registration-on-import features
All reactions