问题描述
我正在尝试在正在使用的新模块中使用键入。我发现了一个交叉引用问题,无法解决。这是我面临的问题的最小表示。
解决方案的成分属性必须是RecipeIngredients的列表 配方成分具有可以是“化合物”或“溶液”类型的成分。
解决方案引用RecipeIngredient,而RecipeIngredient引用Solution。
class Compound():
pass
class Solution():
@property
def ingredients(self,ingredients: List[RecipeIngredient]):
pass
class RecipeIngredient():
@property
def ingredient(self) -> Union[Compound,Solution]:
pass
我不知道该怎么解决。
有人可以帮助我吗?
预先感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)