Chinaunix首页 | 论坛 | 博客
  • 博客访问: 837838
  • 博文数量: 253
  • 博客积分: 6891
  • 博客等级: 准将
  • 技术积分: 2502
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-03 11:01
文章分类

全部博文(253)

文章存档

2016年(4)

2013年(3)

2012年(32)

2011年(184)

2010年(30)

分类: Python/Ruby

2011-06-07 15:10:22

decide if an instance is the given object
isinstance(object, classinfo)

  1. if ((isinstance(data, str) or isinstance(data, unicode)) and
  2.         data.strip().startswith('<')):
  3.         result = True
classinfo can be:
Sequence Types — str, unicode, list, tuple, bytearray, buffer, xrange
Numeric Types — int, float, long, complex

isinstance('1', str), the result is True

阅读(809) | 评论(0) | 转发(0) |
0

上一篇:Python中的SET集合操作

下一篇:python os.path

给主人留下些什么吧!~~