Custom typing in Python 3.8
I have:
/zoo.py
from typing import List
class Zoo(object):
animals: List
/animal.py
from zoo import Zoo
class Animal(object):
zoo: Zoo
How do I determine the type of data in the first file without the cyclicity of imports? I want to get the following
/zoo.py
from typing import List
from animal import Animal
class Zoo(object):
animals: List[Animal]
In large projects, cyclicality interferes. How to use typing correctly in such cases