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.
2 parents d24013d + 9402938 commit 93d731cCopy full SHA for 93d731c
vm/src/stdlib/itertools.rs
@@ -1670,7 +1670,15 @@ mod decl {
1670
}
1671
1672
#[pyclass(with(IterNext, Iterable, Constructor))]
1673
- impl PyItertoolsPermutations {}
+ impl PyItertoolsPermutations {
1674
+ #[pymethod(magic)]
1675
+ fn reduce(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyRef<PyTuple> {
1676
+ vm.new_tuple((
1677
+ zelf.class().to_owned(),
1678
+ vm.new_tuple((zelf.pool.clone(), vm.ctx.new_int(zelf.r.load()))),
1679
+ ))
1680
+ }
1681
1682
impl SelfIter for PyItertoolsPermutations {}
1683
impl IterNext for PyItertoolsPermutations {
1684
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
0 commit comments