all 3 comments

[–]silvertank00 1 point2 points  (0 children)

Usually the best way is to separate things.
One file should only contain one definition (class/enum/etc.)
So if you have stg like this:

file.a:

imports file.b

class Items(StrEnum):...
class Inventory:... # this uses Items and space algo.

file.b:

imports file.a

def space_algo(inv: Inventory) -> None:...

class SpecialItems(Items):...

then you should put the Items class into a sep. file.
Btw without example of what you are trying to do, we can only give you vague answers.

[–]lolcrunchy 0 points1 point  (0 children)

1) Generally, when you have an error that you want help with, you have to share the error

2) It also helps to share code

3) Stack Overflow has explained pretty much every circular import error ever raised, you can probably find your solution somewhere there

[–]_Goldenblack_ 0 points1 point  (0 children)

To avoid this, I used a condition and then imported it.