Skip to content

Commit 9f58921

Browse files
committed
Rename IterNextIterable -> SelfIter by following CPython
1 parent 9b9dd11 commit 9f58921

File tree

26 files changed

+89
-89
lines changed

26 files changed

+89
-89
lines changed

stdlib/src/array.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ mod array {
6161
SliceableSequenceOp,
6262
},
6363
types::{
64-
AsBuffer, AsMapping, AsSequence, Comparable, Constructor, IterNext,
65-
IterNextIterable, Iterable, PyComparisonOp, Representable,
64+
AsBuffer, AsMapping, AsSequence, Comparable, Constructor, IterNext, Iterable,
65+
PyComparisonOp, Representable, SelfIter,
6666
},
6767
AsObject, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult, VirtualMachine,
6868
},
@@ -1422,7 +1422,7 @@ mod array {
14221422
}
14231423
}
14241424

1425-
impl IterNextIterable for PyArrayIter {}
1425+
impl SelfIter for PyArrayIter {}
14261426
impl IterNext for PyArrayIter {
14271427
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
14281428
zelf.internal.lock().next(|array, pos| {

stdlib/src/csv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ mod _csv {
88
function::{ArgIterable, ArgumentError, FromArgs, FuncArgs},
99
match_class,
1010
protocol::{PyIter, PyIterReturn},
11-
types::{IterNext, IterNextIterable, Iterable},
11+
types::{IterNext, Iterable, SelfIter},
1212
AsObject, Py, PyObjectRef, PyPayload, PyResult, TryFromObject, VirtualMachine,
1313
};
1414
use itertools::{self, Itertools};
@@ -168,7 +168,7 @@ mod _csv {
168168

169169
#[pyclass(with(IterNext, Iterable))]
170170
impl Reader {}
171-
impl IterNextIterable for Reader {}
171+
impl SelfIter for Reader {}
172172
impl IterNext for Reader {
173173
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
174174
let string = match zelf.iter.next(vm)? {

stdlib/src/pystruct.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) mod _struct {
1515
function::{ArgBytesLike, ArgMemoryBuffer, PosArgs},
1616
match_class,
1717
protocol::PyIterReturn,
18-
types::{Constructor, IterNext, IterNextIterable, Iterable},
18+
types::{Constructor, IterNext, Iterable, SelfIter},
1919
AsObject, Py, PyObjectRef, PyPayload, PyResult, TryFromObject, VirtualMachine,
2020
};
2121
use crossbeam_utils::atomic::AtomicCell;
@@ -201,7 +201,7 @@ pub(crate) mod _struct {
201201
self.buffer.len().saturating_sub(self.offset.load()) / self.format_spec.size
202202
}
203203
}
204-
impl IterNextIterable for UnpackIterator {}
204+
impl SelfIter for UnpackIterator {}
205205
impl IterNext for UnpackIterator {
206206
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
207207
let size = zelf.format_spec.size;

stdlib/src/sqlite.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ mod _sqlite {
6262
protocol::{PyBuffer, PyIterReturn, PyMappingMethods, PySequence, PySequenceMethods},
6363
sliceable::{SaturatedSliceIter, SliceableSequenceOp},
6464
types::{
65-
AsMapping, AsSequence, Callable, Comparable, Constructor, Hashable, IterNext,
66-
IterNextIterable, Iterable, PyComparisonOp,
65+
AsMapping, AsSequence, Callable, Comparable, Constructor, Hashable, IterNext, Iterable,
66+
PyComparisonOp, SelfIter,
6767
},
6868
utils::ToCString,
6969
AsObject, Py, PyAtomicRef, PyObject, PyObjectRef, PyPayload, PyRef, PyResult,
@@ -1708,7 +1708,7 @@ mod _sqlite {
17081708
}
17091709
}
17101710

1711-
impl IterNextIterable for Cursor {}
1711+
impl SelfIter for Cursor {}
17121712
impl IterNext for Cursor {
17131713
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
17141714
let mut inner = zelf.inner(vm)?;

vm/src/builtins/asyncgenerator.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
frame::FrameRef,
77
function::OptionalArg,
88
protocol::PyIterReturn,
9-
types::{Constructor, IterNext, IterNextIterable, Iterable, Representable, Unconstructible},
9+
types::{Constructor, IterNext, Iterable, Representable, SelfIter, Unconstructible},
1010
AsObject, Context, Py, PyObjectRef, PyPayload, PyRef, PyResult, VirtualMachine,
1111
};
1212

@@ -268,7 +268,7 @@ impl PyAsyncGenASend {
268268
}
269269
}
270270

271-
impl IterNextIterable for PyAsyncGenASend {}
271+
impl SelfIter for PyAsyncGenASend {}
272272
impl IterNext for PyAsyncGenASend {
273273
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
274274
PyIterReturn::from_pyresult(zelf.send(vm.ctx.none(), vm), vm)
@@ -414,7 +414,7 @@ impl PyAsyncGenAThrow {
414414
}
415415
}
416416

417-
impl IterNextIterable for PyAsyncGenAThrow {}
417+
impl SelfIter for PyAsyncGenAThrow {}
418418
impl IterNext for PyAsyncGenAThrow {
419419
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
420420
PyIterReturn::from_pyresult(zelf.send(vm.ctx.none(), vm), vm)

vm/src/builtins/bytearray.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::{
3131
sliceable::{SequenceIndex, SliceableSequenceMutOp, SliceableSequenceOp},
3232
types::{
3333
AsBuffer, AsMapping, AsNumber, AsSequence, Callable, Comparable, Constructor, Initializer,
34-
IterNext, IterNextIterable, Iterable, PyComparisonOp, Representable, Unconstructible,
34+
IterNext, Iterable, PyComparisonOp, Representable, SelfIter, Unconstructible,
3535
},
3636
AsObject, Context, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult, TryFromObject,
3737
VirtualMachine,
@@ -914,7 +914,7 @@ impl PyByteArrayIterator {
914914

915915
impl Unconstructible for PyByteArrayIterator {}
916916

917-
impl IterNextIterable for PyByteArrayIterator {}
917+
impl SelfIter for PyByteArrayIterator {}
918918
impl IterNext for PyByteArrayIterator {
919919
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
920920
zelf.internal.lock().next(|bytearray, pos| {

vm/src/builtins/bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::{
2121
sliceable::{SequenceIndex, SliceableSequenceOp},
2222
types::{
2323
AsBuffer, AsMapping, AsNumber, AsSequence, Callable, Comparable, Constructor, Hashable,
24-
IterNext, IterNextIterable, Iterable, PyComparisonOp, Representable, Unconstructible,
24+
IterNext, Iterable, PyComparisonOp, Representable, SelfIter, Unconstructible,
2525
},
2626
AsObject, Context, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult,
2727
TryFromBorrowedObject, TryFromObject, VirtualMachine,
@@ -711,7 +711,7 @@ impl PyBytesIterator {
711711
}
712712
impl Unconstructible for PyBytesIterator {}
713713

714-
impl IterNextIterable for PyBytesIterator {}
714+
impl SelfIter for PyBytesIterator {}
715715
impl IterNext for PyBytesIterator {
716716
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
717717
zelf.internal.lock().next(|bytes, pos| {

vm/src/builtins/coroutine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
frame::FrameRef,
66
function::OptionalArg,
77
protocol::PyIterReturn,
8-
types::{Constructor, IterNext, IterNextIterable, Iterable, Representable, Unconstructible},
8+
types::{Constructor, IterNext, Iterable, Representable, SelfIter, Unconstructible},
99
AsObject, Context, Py, PyObjectRef, PyPayload, PyRef, PyResult, VirtualMachine,
1010
};
1111

@@ -108,7 +108,7 @@ impl Representable for PyCoroutine {
108108
}
109109
}
110110

111-
impl IterNextIterable for PyCoroutine {}
111+
impl SelfIter for PyCoroutine {}
112112
impl IterNext for PyCoroutine {
113113
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
114114
Self::send(zelf, vm.ctx.none(), vm)
@@ -147,7 +147,7 @@ impl PyCoroutineWrapper {
147147
}
148148
}
149149

150-
impl IterNextIterable for PyCoroutineWrapper {}
150+
impl SelfIter for PyCoroutineWrapper {}
151151
impl IterNext for PyCoroutineWrapper {
152152
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
153153
Self::send(zelf, vm.ctx.none(), vm)

vm/src/builtins/dict.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::{
2020
recursion::ReprGuard,
2121
types::{
2222
AsMapping, AsNumber, AsSequence, Callable, Comparable, Constructor, Initializer, IterNext,
23-
IterNextIterable, Iterable, PyComparisonOp, Representable, Unconstructible,
23+
Iterable, PyComparisonOp, Representable, SelfIter, Unconstructible,
2424
},
2525
vm::VirtualMachine,
2626
AsObject, Context, Py, PyObject, PyObjectRef, PyPayload, PyRef, PyRefExact, PyResult,
@@ -870,7 +870,7 @@ macro_rules! dict_view {
870870
}
871871
impl Unconstructible for $iter_name {}
872872

873-
impl IterNextIterable for $iter_name {}
873+
impl SelfIter for $iter_name {}
874874
impl IterNext for $iter_name {
875875
#[allow(clippy::redundant_closure_call)]
876876
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
@@ -948,7 +948,7 @@ macro_rules! dict_view {
948948
}
949949
impl Unconstructible for $reverse_iter_name {}
950950

951-
impl IterNextIterable for $reverse_iter_name {}
951+
impl SelfIter for $reverse_iter_name {}
952952
impl IterNext for $reverse_iter_name {
953953
#[allow(clippy::redundant_closure_call)]
954954
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {

vm/src/builtins/enumerate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{
77
convert::ToPyObject,
88
function::OptionalArg,
99
protocol::{PyIter, PyIterReturn},
10-
types::{Constructor, IterNext, IterNextIterable, Iterable},
10+
types::{Constructor, IterNext, Iterable, SelfIter},
1111
AsObject, Context, Py, PyObjectRef, PyPayload, PyResult, VirtualMachine,
1212
};
1313
use num_bigint::BigInt;
@@ -71,7 +71,7 @@ impl Py<PyEnumerate> {
7171
}
7272
}
7373

74-
impl IterNextIterable for PyEnumerate {}
74+
impl SelfIter for PyEnumerate {}
7575
impl IterNext for PyEnumerate {
7676
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
7777
let next_obj = match zelf.iterator.next(vm)? {
@@ -130,7 +130,7 @@ impl PyReverseSequenceIterator {
130130
}
131131
}
132132

133-
impl IterNextIterable for PyReverseSequenceIterator {}
133+
impl SelfIter for PyReverseSequenceIterator {}
134134
impl IterNext for PyReverseSequenceIterator {
135135
fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> {
136136
zelf.internal

0 commit comments

Comments
 (0)