itertools.js:Python很棒的itertools stdlibJavaScript端口

时间:2021-04-30 00:39:25
【文件属性】:
文件名称:itertools.js:Python很棒的itertools stdlibJavaScript端口
文件大小:146KB
文件格式:ZIP
更新时间:2021-04-30 00:39:25
JavaScript Python很棒的标准库JavaScript端口。 用法示例: >>> import { izip , cycle } from 'itertools' ; >>> >>> const xs = [ 1 , 2 , 3 , 4 ] ; >>> const ys = [ 'hello' , 'there' ] ; >>> for ( const [ x , y ] of izip ( xs , cycle ( ys ) ) ) { >>> console . log ( x , y ) ; >>> } 1 'hello' 2 'there' 3 'hello' 4 'there' 关于参数顺序 在Python中,许多itertools都将函数作为参数。 在这些的JS端口中,我们最初将这些顺序保持不变以紧贴Python函数,但实际上,翻转它们实际上更为实用,因此该函数成为第二个参数
【文件预览】:
itertools.js-master
----bin()
--------bump.sh(657B)
--------build.sh(2KB)
--------publish.sh(1KB)
----.babelrc(180B)
----flow-typed()
--------npm()
----.flowconfig(281B)
----package.json(3KB)
----.eslintrc.json(2KB)
----.github()
--------dependabot.yml(161B)
--------workflows()
----.prettierrc(130B)
----.importsortrc(66B)
----LICENSE(1KB)
----src()
--------utils.js(1KB)
--------index.js(824B)
--------more-itertools.js(7KB)
--------builtins.js(9KB)
--------__tests__()
--------itertools.js(13KB)
--------custom.js(2KB)
--------types.js(144B)
----.gitignore(30B)
----CHANGELOG.md(1KB)
----.envrc(44B)
----README.md(28KB)
----yarn.lock(274KB)

网友评论