We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f920982 commit d4e5d76Copy full SHA for d4e5d76
vm/src/stdlib/itertools.rs
@@ -556,20 +556,19 @@ impl PyItertoolsAccumulate {
556
#[pymethod(name = "__new__")]
557
#[allow(clippy::new_ret_no_self)]
558
fn new(
559
- _cls: PyClassRef,
+ cls: PyClassRef,
560
iterable: PyObjectRef,
561
binop: OptionalArg<PyObjectRef>,
562
vm: &VirtualMachine,
563
- ) -> PyResult {
+ ) -> PyResult<PyRef<PyItertoolsAccumulate>> {
564
let iter = get_iter(vm, &iterable)?;
565
566
- Ok(PyItertoolsAccumulate {
+ PyItertoolsAccumulate {
567
iterable: iter,
568
binop: binop.unwrap_or_else(|| vm.get_none()),
569
acc_value: RefCell::from(Option::None),
570
}
571
- .into_ref(vm)
572
- .into_object())
+ .into_ref_with_type(vm, cls)
573
574
575
#[pymethod(name = "__next__")]
0 commit comments