Skip to content

Commit 3559c28

Browse files
Make chain and repeat immutable
1 parent f2b81f3 commit 3559c28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Modules/itertoolsmodule.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,8 @@ static PyType_Slot chain_slots[] = {
21932193
static PyType_Spec chain_spec = {
21942194
.name = "itertools.chain",
21952195
.basicsize = sizeof(chainobject),
2196-
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
2196+
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
2197+
Py_TPFLAGS_IMMUTABLETYPE),
21972198
.slots = chain_slots,
21982199
};
21992200

@@ -4303,7 +4304,8 @@ static PyType_Slot repeat_slots[] = {
43034304
static PyType_Spec repeat_spec = {
43044305
.name = "itertools.repeat",
43054306
.basicsize = sizeof(repeatobject),
4306-
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
4307+
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE |
4308+
Py_TPFLAGS_IMMUTABLETYPE),
43074309
.slots = repeat_slots,
43084310
};
43094311

0 commit comments

Comments
 (0)