From 2d50cfa02281adde99b8d0845d92872e2caafa83 Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Mon, 27 Apr 2020 00:17:36 +0900 Subject: [PATCH] Add itertools class names --- vm/src/stdlib/itertools.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/vm/src/stdlib/itertools.rs b/vm/src/stdlib/itertools.rs index 3ffc01e80..f41a7f2c2 100644 --- a/vm/src/stdlib/itertools.rs +++ b/vm/src/stdlib/itertools.rs @@ -139,7 +139,7 @@ impl PyItertoolsCompress { } } -#[pyclass] +#[pyclass(name = "count")] #[derive(Debug)] struct PyItertoolsCount { cur: RefCell, @@ -190,7 +190,7 @@ impl PyItertoolsCount { } } -#[pyclass] +#[pyclass(name = "cycle")] #[derive(Debug)] struct PyItertoolsCycle { iter: RefCell, @@ -257,7 +257,7 @@ impl PyItertoolsCycle { } } -#[pyclass] +#[pyclass(name = "repeat")] #[derive(Debug)] struct PyItertoolsRepeat { object: PyObjectRef, @@ -358,7 +358,7 @@ impl PyItertoolsStarmap { } } -#[pyclass] +#[pyclass(name = "takewhile")] #[derive(Debug)] struct PyItertoolsTakewhile { predicate: PyObjectRef, @@ -417,7 +417,7 @@ impl PyItertoolsTakewhile { } } -#[pyclass] +#[pyclass(name = "dropwhile")] #[derive(Debug)] struct PyItertoolsDropwhile { predicate: PyCallable, @@ -601,7 +601,7 @@ impl PyItertoolsIslice { } } -#[pyclass] +#[pyclass(name = "filterfalse")] #[derive(Debug)] struct PyItertoolsFilterFalse { predicate: PyObjectRef, @@ -657,7 +657,7 @@ impl PyItertoolsFilterFalse { } } -#[pyclass] +#[pyclass(name = "accumulate")] #[derive(Debug)] struct PyItertoolsAccumulate { iterable: PyObjectRef, @@ -739,7 +739,7 @@ impl PyItertoolsTeeData { } } -#[pyclass] +#[pyclass(name = "tee")] #[derive(Debug)] struct PyItertoolsTee { tee_data: Rc, @@ -817,7 +817,7 @@ impl PyItertoolsTee { } } -#[pyclass] +#[pyclass(name = "product")] #[derive(Debug)] struct PyItertoolsProduct { pools: Vec>, @@ -934,7 +934,7 @@ impl PyItertoolsProduct { } } -#[pyclass] +#[pyclass(name = "combinations")] #[derive(Debug)] struct PyItertoolsCombinations { pool: Vec, @@ -1033,7 +1033,7 @@ impl PyItertoolsCombinations { } } -#[pyclass] +#[pyclass(name = "combinations_with_replacement")] #[derive(Debug)] struct PyItertoolsCombinationsWithReplacement { pool: Vec, @@ -1127,7 +1127,7 @@ impl PyItertoolsCombinationsWithReplacement { } } -#[pyclass] +#[pyclass(name = "permutations")] #[derive(Debug)] struct PyItertoolsPermutations { pool: Vec, // Collected input iterable @@ -1257,15 +1257,15 @@ impl PyItertoolsPermutations { } } -#[pyclass] +#[pyclass(name = "zip_longest")] #[derive(Debug)] -struct PyItertoolsZiplongest { +struct PyItertoolsZipLongest { iterators: Vec, fillvalue: PyObjectRef, numactive: Cell, } -impl PyValue for PyItertoolsZiplongest { +impl PyValue for PyItertoolsZipLongest { fn class(vm: &VirtualMachine) -> PyClassRef { vm.class("itertools", "zip_longest") } @@ -1278,7 +1278,7 @@ struct ZiplongestArgs { } #[pyimpl] -impl PyItertoolsZiplongest { +impl PyItertoolsZipLongest { #[pyslot] fn tp_new( cls: PyClassRef, @@ -1298,7 +1298,7 @@ impl PyItertoolsZiplongest { let numactive = Cell::new(iterators.len()); - PyItertoolsZiplongest { + PyItertoolsZipLongest { iterators, fillvalue, numactive, @@ -1389,7 +1389,7 @@ pub fn make_module(vm: &VirtualMachine) -> PyObjectRef { PyItertoolsTee::extend_class(ctx, &tee); let zip_longest = ctx.new_class("zip_longest", ctx.object()); - PyItertoolsZiplongest::extend_class(ctx, &zip_longest); + PyItertoolsZipLongest::extend_class(ctx, &zip_longest); py_module!(vm, "itertools", { "accumulate" => accumulate,