10000 bpo-43908: Make heap types converted during 3.10 alpha immutable by erlend-aasland · Pull Request #26351 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43908: Make heap types converted during 3.10 alpha immutable #26351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extensio 8000 n

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
_operator types are now immutable
  • Loading branch information
Erlend E. Aasland committed May 25, 2021
commit 261767c478659f17ab92a57ae6c12fae467fd19b
9 changes: 6 additions & 3 deletions Modules/_operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,8 @@ static PyType_Spec itemgetter_type_spec = {
.name = "operator.itemgetter",
.basicsize = sizeof(itemgetterobject),
.itemsize = 0,
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_IMMUTABLETYPE),
.slots = itemgetter_type_slots,
};

Expand Down Expand Up @@ -1446,7 +1447,8 @@ static PyType_Spec attrgetter_type_spec = {
.name = "operator.attrgetter",
.basicsize = sizeof(attrgetterobject),
.itemsize = 0,
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_IMMUTABLETYPE),
.slots = attrgetter_type_slots,
};

Expand Down Expand Up @@ -1691,7 +1693,8 @@ static PyType_Spec methodcaller_type_spec = {
.name = "operator.methodcaller",
.basicsize = sizeof(methodcallerobject),
.itemsize = 0,
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
.flags = (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
Py_TPFLAGS_IMMUTABLETYPE),
.slots = methodcaller_type_slots,
};

Expand Down
0