python类型校验type

 1 >>> if type(l)==type([]):
 2     print("y")
 3 
 4     
 5 y
 6 >>> type(l)==type([])
 7 True
 8 >>> type(l)==list
 9 True
10 >>> isinstance(l,list)
11 True
12 >>> 

 

posted @ 2017-10-09 17:43  xiongjiawei  阅读(265)  评论(0编辑  收藏  举报