iter:
def iter(source, sentinel=None): # known special case of iter """ iter(iterable) -> 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. """ pass
l=['a','b','c','d'] def test(): return l.pop() y=iter(test,'b') print(y.__next__()) print(y.__next__()) # print(y.__next__()) # print(y.__next__())
partial
from functools import partial def add(x,y): return x+y # print(add(1,5)) # func=partial(add,8) #偏函数 print(func(1)) print(func(2))