Skip to content

Commit 60e3ce2

Browse files
committed
Add basetype flag to itertools module
1 parent d3e8e47 commit 60e3ce2

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Lib/test/test_itertools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,8 +2268,6 @@ def __eq__(self, other):
22682268

22692269

22702270
class SubclassWithKwargsTest(unittest.TestCase):
2271-
# TODO: RUSTPYTHON
2272-
@unittest.expectedFailure
22732271
def test_keywords_in_subclass(self):
22742272
# count is not subclassable...
22752273
for cls in (repeat, zip, filter, filterfalse, chain, map,

vm/src/stdlib/itertools.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ mod decl {
2828
active: PyRwLock<Option<PyIter>>,
2929
}
3030

31-
#[pyimpl(with(IterNext))]
31+
#[pyimpl(with(IterNext), flags(BASETYPE))]
3232
impl PyItertoolsChain {
3333
#[pyslot]
3434
fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
@@ -140,7 +140,7 @@ mod decl {
140140
}
141141
}
142142

143-
#[pyimpl(with(IterNext, Constructor))]
143+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
144144
impl PyItertoolsCompress {
145145
#[pymethod(magic)]
146146
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (PyIter, PyIter)) {
@@ -263,7 +263,7 @@ mod decl {
263263
}
264264
}
265265

266-
#[pyimpl(with(IterNext, Constructor))]
266+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
267267
impl PyItertoolsCycle {}
268268
impl IterNextIterable for PyItertoolsCycle {}
269269
impl IterNext for PyItertoolsCycle {
@@ -403,7 +403,7 @@ mod decl {
403403
}
404404
}
405405

406-
#[pyimpl(with(IterNext, Constructor))]
406+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
407407
impl PyItertoolsStarmap {}
408408
impl IterNextIterable for PyItertoolsStarmap {}
409409
impl IterNext for PyItertoolsStarmap {
@@ -458,7 +458,7 @@ mod decl {
458458
}
459459
}
460460

461-
#[pyimpl(with(IterNext, Constructor))]
461+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
462462
impl PyItertoolsTakewhile {}
463463
impl IterNextIterable for PyItertoolsTakewhile {}
464464
impl IterNext for PyItertoolsTakewhile {
@@ -523,7 +523,7 @@ mod decl {
523523
}
524524
}
525525

526-
#[pyimpl(with(IterNext, Constructor))]
526+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
527527
impl PyItertoolsDropwhile {}
528528
impl IterNextIterable for PyItertoolsDropwhile {}
529529
impl IterNext for PyItertoolsDropwhile {
@@ -773,7 +773,7 @@ mod decl {
773773
)))
774774
}
775775

776-
#[pyimpl(with(IterNext))]
776+
#[pyimpl(with(IterNext), flags(BASETYPE))]
777777
impl PyItertoolsIslice {
778778
#[pyslot]
779779
fn slot_new(cls: PyTypeRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult {
@@ -902,7 +902,7 @@ mod decl {
902902
}
903903
}
904904

905-
#[pyimpl(with(IterNext, Constructor))]
905+
#[pyimpl(with(IterNext, Constructor), flags(BASETYPE))]
906906
impl PyItertoolsFilterFalse {
907907
#[pymethod(magic)]
908908
fn reduce(zelf: PyRef<Self>) -> (PyTypeRef, (PyObjectRef, PyIter)) {

0 commit comments

Comments
 (0)