Skip to content

Commit 7490724

Browse files
committed
Add itertools module skeleton
1 parent 0a683f2 commit 7490724

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

tests/snippets/stdlib_itertools.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import itertools

vm/src/stdlib/itertools.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
use crate::pyobject::PyObjectRef;
2+
use crate::vm::VirtualMachine;
3+
4+
pub fn make_module(vm: &VirtualMachine) -> PyObjectRef {
5+
py_module!(vm, "itertools", {
6+
})
7+
}

vm/src/stdlib/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
mod ast;
22
mod dis;
3+
mod itertools;
34
pub(crate) mod json;
45
mod keyword;
56
mod math;
@@ -34,6 +35,7 @@ pub fn get_module_inits() -> HashMap<String, StdlibInitFunc> {
3435
Box::new(ast::make_module) as StdlibInitFunc,
3536
);
3637
modules.insert("dis".to_string(), Box::new(dis::make_module));
38+
modules.insert("itertools".to_string(), Box::new(itertools::make_module));
3739
modules.insert("json".to_string(), Box::new(json::make_module));
3840
modules.insert("keyword".to_string(), Box::new(keyword::make_module));
3941
modules.insert("math".to_string(), Box::new(math::make_module));

0 commit comments

Comments
 (0)