Imports inside application factory #4275
-
Hi everyone! I am curious what's the rationale behind using imports inside the application factory function instead of regular top-level imports? See |
Beta Was this translation helpful? Give feedback.
Answered by
miguelgrinberg
Sep 30, 2021
Replies: 2 comments 5 replies
-
I think I got it. Is it because when importing from a package it automatically invokes the init file? If so, I am curious why then importing at the top-level doesn't break anything? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Imports inside the factory function are one of the techniques you can use to avoid circular import errors. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
fatadel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Imports inside the factory function are one of the techniques you can use to avoid circular import errors.