python之函数用法basestring

# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python之函数用法basestring
#http://www.cnblogs.com/oneday/archive/2012/08/16/2643039.html



#basestring()
#说明:basestring是str和unicode的超类。
#意义有限,仅作了解

print isinstance('xiaodeng',str)#True
print isinstance('xiaodeng',unicode)#False
print isinstance(u'xiaodeng',unicode)#True
print isinstance('xiaodeng',basestring)#True
print isinstance(u'凤梅',unicode)#True
print isinstance(u'凤梅',basestring)#True

 

posted @ 2015-11-07 16:36  Xiao|Deng  阅读(933)  评论(0编辑  收藏  举报