|||
functools.
partial
(func[,*args][, **keywords])
Return a new partial object which when called will behave like func called with the positional arguments args and keyword arguments keywords.
For example, partial()
can be used to create a callable that behaves like the int()
function where the base argument defaults to two:
https://docs.python.org/2/library/functools.html?highlight=functools%20partial#functools.partial
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-10-19 23:13
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社