About 54 results
Open links in new tab
  1. How to avoid circular imports in Python? - Stack Overflow

    Feb 8, 2017 · Circular import dependencies typically fall into two categories depending on what you're trying to import and where you're using it inside each module. (And whether you're …

  2. python - What happens when using mutual or circular (cyclic) …

    Examples of working circular imports in Python 2 and Python 3 The article When are Python circular imports fatal? gives four examples when circular imports are, for the reason explained …

  3. python - Pythonic way to resolve circular import statements?

    Apr 6, 2016 · from calendarLib import CalendarPage File "c:\temp\calendarLib.py", line 2, in ? from homePageLib import HomePage ImportError: cannot import name HomePage Rather …

  4. python - Why do circular imports seemingly work further up in the …

    Is there some unwritten rule about circular importing? How do I use the same class further down the call stack? See also What happens when using mutual or circular (cyclic) imports in …

  5. Circular import dependency in Python - Stack Overflow

    Sometimes circular references are precisely the correct way to model the problem. The notion that circular dependencies are somehow an indication of poor design seems to be more a …

  6. Avoiding circular (cyclic) imports in Python? - Stack Overflow

    Dec 13, 2012 · You're usually supposed to do import A and refer to the qualified names. For quick&dirty scripts, and interactive sessions, that's a perfectly reasonable thing to do—but in …

  7. python - Detecting circular imports - Stack Overflow

    Mar 9, 2010 · Circular imports in Python are not like PHP includes. Python imported modules are loaded the first time into an import "handler", and kept there for the duration of the process.

  8. Python Circular import: solutions and best practice

    I'm writing an application for scientific data analysis and I'm wondering what's the best way to structure the code to avoid (or address) the circular import problem. Currently I'm using a mix …

  9. python - Type hints: solve circular dependency - Stack Overflow

    Nov 21, 2015 · 7 If you are on Python 3.7+, use from __future__ import annotations as mentioned in another answer. However, if you cannot use 3.7 yet due to OS limitation (like Cygwin as of …

  10. How to fix a circular dependency for imports - Stack Overflow

    python import python-3.x circular-dependency edited May 27, 2016 at 17:43 the Tin Man 161k 44 222 308