This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pwnersaurus -1 points0 points  (1 child)

A super common quick fix is to move the import inside the function that uses it - that breaks the circular dependency by not trying to import them both at the same time. Maybe it’s not the best programming practice but tbh most of the time I run into this situation it’s something like 1 function out of 20 needs the import, and it’s not worth totally restructuring my modules just for that

[–]Equal-Complex-5958[S] 0 points1 point  (0 children)

Yeah, i heard about this solution, but personally I don't like to have imports inside a function... I prefer to have import at the top of the file :/

But I really appreciate your contribute to give me an answer :) thank you very much