def retspec(defs):
# return specs
# only return 1, so if there is more than one type
# we need to include a union
# In truth there is only 1 return
# Error or the expected Type
if not defs:
return None
if defs in basic_types:
return strcast(defs, False)
rtypes = _registry.getObj(_types[defs])
if not rtypes:
return None
if len(rtypes) > 1:
return Union[tuple([strcast(r[1], True) for r in rtypes])]
return strcast(rtypes[0][1], False)
评论列表
文章目录