懒多处理三个额外字符中的可调用项
binge的Python项目详细描述
Name: | binge |
---|---|
Website: | https://github.com/ceyzeriat/binge |
Author: | Guillaume Schworer |
Version: | 0.1 |
懒多处理您的可调用文件,只需三个额外字符
由Guillaume Schworer创建。许可证 gnu通用公共许可v3或更高版本(gplv3+)许可证(请参见LICENSE)。
安装
只需运行
pip install binge
以获得最新的稳定版本。
用法
唯一的入口点是binge.Bclasse。你就这样使用它:
>importtime>frombingeimportB>deff(x,a=2):>time.sleep(1)>returnx*a# normal call>[f(x)forxinrange(4)][0,2,4,6]# takes 4 seconds to run# binged call, using 3 extra characters: `B`, `(`, and `)`>B(f)([xforxinrange(4)])[0,2,4,6]# takes 1 second to run on 4 CPUs# and if you're very lazy, you could even call>B(f)(range(4))# and what about the `a` parameter? - too easy>B(f)(range(4),3)[0,3,6,9]# and guess what also works?>B(f)(range(4),a=[1,2,3,6])[0,2,6,18]
更多使用详细信息,请参见example.py
文档
所有选项都记录在B类的docstrings中。 可以在python shell中使用:
frombingeimportBprint(B.__doc__)
或者,在ipython中使用:
frombingeimportBB?
许可证
版权所有2018 Guillaume Schworer
疯狂是在GNU通用下提供的免费软件 公共许可证v3或更高版本(gplv3+)许可证(请参见LICENSE)。
更改日志
0.1.0(2018-05-03)
- 初始版本