最近有点忙,心情也挺低落, 把博客的更新速度落下了,后续会慢慢跟上。
在这里不得不吐槽下新浪云的共享型mysql的突然收费,而且还是针对每个应用的。 正在考虑将博客站迁移到aws上。
难得放假, 心情还是开朗了不少,清明除了缅怀逝去的亲人还应该多出去走走,感受下越来越来难得的春意。
(以下省略)
四十五、iter方法
1、定义:
iter(...)
iter(collection) -> iterator
iter(callable, sentinel) -> iterator
Get an iterator from an object. In the first form, the argument must
supply its own iterator, or be a sequence.
In the second form, the callable is called until it returns the sentinel.2、解释:得到一个对象的迭代器, 第一种调用方式,传入参数本身必须可迭代,或者是一个序列。
第二张调用方式, callable会被一直调用直到返回与sentinel一样的内容。
(以下省略)
四十三、isinstance方法
1、定义:
isinstance(...)
isinstance(object, class-or-type-or-tuple) -> bool
Return whether an object is an instance of a class or of a subclass thereof. With a type as second argument, return whether that is the object's type.
The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for
isinstance(x, A) or isinstance(x, B) or ... (etc.).2、解释:返回bool类型。用来判断一个对象是否是一个类的实例或者子类的实例,或者判断是否为某种对象类型。
3、举例:
>>> isinstance('aa',basestring)
True
>>> isinstance(u'aa',basestring)
True
>>> isinstance(1,(basestring,int))
True
>>> isinstance('aa',str)
True
>>> isinstance(u'aa',str)
False四十四、issubclass方法
(以下省略)
Copyright © 2021.aoyanming个人博客站