I’m wondering if anyone could help me understand something from the ‘contributing.md’ documentation. One section reads as follows:
In cases where you have two modules that reference each other, you can fix the
import cycle by using fully qualified names in the types, and enabling
annotations. For example, instead of
from aqt.browser import Browser
def myfunc(b: Browser) -> None:
pass
Is the problem that the first example would cause a circular import somehow? Is this an issue only when contributing to the anki source base or also when writing an addon?
Is the problem that the first example would cause a circular import somehow? Is this an issue only when contributing to the anki source base or also when writing an addon?
The section is contributing.md was targeted at users contributing to Anki’s codebase - when importing Anki’s code into your own add-on, either approach should work since it’s a one-way import.