Skip to content

Commit 81d2df8

Browse files
committed
fix: itertools.compress keyword arguments
1 parent 50dba86 commit 81d2df8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

vm/src/stdlib/itertools.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,26 @@ mod decl {
116116
#[derive(Debug, PyPayload)]
117117
struct PyItertoolsCompress {
118118
data: PyIter,
119-
selector: PyIter,
119+
selectors: PyIter,
120120
}
121121

122122
#[derive(FromArgs)]
123123
struct CompressNewArgs {
124-
#[pyarg(positional)]
124+
#[pyarg(any)]
125125
data: PyIter,
126-
#[pyarg(positional)]
127-
selector: PyIter,
126+
#[pyarg(any)]
127+
selectors: PyIter,
128128
}
129129

130130
impl Constructor for PyItertoolsCompress {
131131
type Args = CompressNewArgs;
132132

133133
fn py_new(
134134
cls: PyTypeRef,
135-
Self::Args { data, selector }: Self::Args,
135+
Self::Args { data, selectors }: Self::Args,
136136
vm: &VirtualMachine,
137137
) -> PyResult {
138-
PyItertoolsCompress { data, selector }
138+
PyItertoolsCompress { data, selectors }
139139
.into_ref_with_type(vm, cls)
140140
.map(Into::into)
141141
}
@@ -148,7 +148,7 @@ mod decl {
148148
impl IterNext for PyItertoolsCompress {
149149
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
150150
loop {
151-
let sel_obj = match zelf.selector.next(vm)? {
151+
let sel_obj = match zelf.selectors.next(vm)? {
152152
PyIterReturn::Return(obj) => obj,
153153
PyIterReturn::StopIteration(v) => return Ok(PyIterReturn::StopIteration(v)),
154154
};

0 commit comments

Comments
 (0)