diff --git a/tests/snippets/builtin_slice.py b/tests/snippets/builtin_slice.py
new file mode 100644
index 000000000..402a90133
--- /dev/null
+++ b/tests/snippets/builtin_slice.py
@@ -0,0 +1,45 @@
+
+a = []
+assert a[:] == []
+assert a[:2**100] == []
+assert a[-2**100:] == []
+assert a[::2**100] == []
+assert a[10:20] == []
+assert a[-20:-10] == []
+
+b = [1, 2]
+
+assert b[:] == [1, 2]
+assert b[:2**100] == [1, 2]
+assert b[-2**100:] == [1, 2]
+assert b[2**100:] == []
+assert b[::2**100] == [1]
+assert b[-10:1] == [1]
+
+slice_a = slice(5)
+assert slice_a.start is None
+assert slice_a.stop == 5
+assert slice_a.step is None
+
+slice_b = slice(1, 5)
+assert slice_b.start == 1
+assert slice_b.stop == 5
+assert slice_b.step is None
+
+slice_c = slice(1, 5, 2)
+assert slice_c.start == 1
+assert slice_c.stop == 5
+assert slice_c.step == 2
+
+
+class SubScript(object):
+ def __getitem__(self, item):
+ assert type(item) == slice
+
+ def __setitem__(self, key, value):
+ assert type(key) == slice
+
+
+ss = SubScript()
+_ = ss[:]
+ss[:1] = 1
diff --git a/vm/src/builtins.rs b/vm/src/builtins.rs
index f8df09a62..cad71c42e 100644
--- a/vm/src/builtins.rs
+++ b/vm/src/builtins.rs
@@ -677,6 +677,7 @@ pub fn make_module(ctx: &PyContext) -> PyObjectRef {
ctx.set_attr(&py_mod, "repr", ctx.new_rustfunc(builtin_repr));
ctx.set_attr(&py_mod, "set", ctx.set_type());
ctx.set_attr(&py_mod, "setattr", ctx.new_rustfunc(builtin_setattr));
+ ctx.set_attr(&py_mod, "slice", ctx.slice_type());
ctx.set_attr(&py_mod, "staticmethod", ctx.staticmethod_type());
ctx.set_attr(&py_mod, "str", ctx.str_type());
ctx.set_attr(&py_mod, "sum", ctx.new_rustfunc(builtin_sum));
diff --git a/vm/src/frame.rs b/vm/src/frame.rs
index 54fbf415b..b1b7952e2 100644
--- a/vm/src/frame.rs
+++ b/vm/src/frame.rs
@@ -20,7 +20,7 @@ use super::pyobject::{
PyResult, TypeProtocol,
};
use super::vm::VirtualMachine;
-use num_traits::ToPrimitive;
+use num_bigint::BigInt;
#[derive(Clone, Debug)]
enum Block {
@@ -262,22 +262,22 @@ impl Frame {
assert!(*size == 2 || *size == 3);
let elements = self.pop_multiple(*size);
- let mut out: Vec