def add(a,b,c):
return a+b+c
from functools import partial
addone = partial(add,100)
print addone(100,320)
print type(addone) #<type 'functools.partial'>
print type(add) #<type 'function'>
def add(a,b,c):
return a+b+c
from functools import partial
addone = partial(add,100)
print addone(100,320)
print type(addone) #<type 'functools.partial'>
print type(add) #<type 'function'>
本文标题:functools partial
本文链接:https://www.haomeiwen.com/subject/ksplqqtx.html
网友评论