How to avoid circular dependencies in python?

Asked 2 years ago

I'm trying to avoid circular dependencies in my Python code, but I'm not sure how. I know it can cause conflict problems in the future and I'm just trying to find an easy way to avoid doing it.

Ellis Callahan

Friday, July 08, 2022

There are a few ways to avoid circular dependencies in python: - Use importlib.import_module instead of __import__ - Use os.path.realpath(__file__) to get the absolute path of the current file - Use sys.modules to check if a module has already been imported





Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?