partial function
[partial function]
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. If more arguments are supplied to the call, they are appended to args. If additional keyword arguments are supplied, they extend and override keywords. Roughly equivalent to:
The partial() is used for partial function application which “freezes” some portion of a function’s arguments and/or keywords resulting in a new object with a simplified signature. For example, partial() can be used to create a callable that behaves like the int() function where the base argument defaults to two:
参考: http://docs.python.org/2.7/library/functools.html
最新文章
- SQL Server需要监控哪些计数器
- TCP通信丢包原因总结
- 删除win8的网络连接记录
- android 下载文件,file的读写应用
- SpringMVC学习笔记(一)
- Android使用SAX解析XML(1)
- 用 get 同步/异步 方式获取网络数据并输出
- block捕获自动变量和对象
- Python和Ruby开发中源文件中文注释乱码的解决方法(Eclipse和Aptana Studio3均适用)
- asp.net web.config 经典模式和集成模式相关配置
- 完整的开发一个ContentProvider步骤
- Python mining
- 更换arm-linux-gcc 4.3.2编译器
- 第一周-JAVA基本概念
- 08机器学习实战之BP神经网络
- Howto Building GNU Toolchains
- 【转】28个Unix/Linux的命令行神器
- 命令行登录远程Mysql
- NSObject协议中方法:description 和 debugDescription
- Python pyQt4/PyQt5 学习笔记3(绝对对位,盒布局,网格布局)