def _from_typing36(t):
'''Support for 3.6 version of typing module
'''
try:
origin = t.__origin__
except AttributeError:
# not typing.Generic
return Typeable(typ=t, origin=None, args=[], arity=0)
# is a base type
if not origin:
return Typeable(typ=t, origin=None, args=[], arity=1)
args = [from_type(t_) for t_ in t.__args__]
return Typeable(typ=t, origin=from_type(origin), args=args, arity=get_arity(origin, args))
评论列表
文章目录