typesafe-形式类型断言修饰符
typesafe的Python项目详细描述
typesafe-形式类型断言修饰符
用法:
来自typesafe导入*
@硬类型(name=str,age=(int,float))
定义函数或方法(名称、年龄):
通过
@硬类型(dict(name=str,age=(int,float)))
定义函数或方法(名称、年龄):
通过
@types\u hard()修饰符引发hardtypesexception,除非
调用参数属于指定类型:
@硬类型(argname=type,[…])
@硬类型(argname=types,[…])
@types\u soft()修饰符引发SoftTypesException,除非
调用参数类型与指定的
类型。
@类型软(argname=type,[…])
@类型软(argname=types,[…])
用法:
来自typesafe导入*
@硬类型(name=str,age=(int,float))
定义函数或方法(名称、年龄):
通过
@硬类型(dict(name=str,age=(int,float)))
定义函数或方法(名称、年龄):
通过
@types\u hard()修饰符引发hardtypesexception,除非
调用参数属于指定类型:
@硬类型(argname=type,[…])
@硬类型(argname=types,[…])
@types\u soft()修饰符引发SoftTypesException,除非
调用参数类型与指定的
类型。
@类型软(argname=type,[…])
@类型软(argname=types,[…])