mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
GH-94254: Make _struct module types immutable (#94269)
This commit is contained in:
parent
27934bef2d
commit
17ed560fcd
3 changed files with 17 additions and 2 deletions
|
|
@ -1741,7 +1741,8 @@ static PyType_Spec unpackiter_type_spec = {
|
|||
"_struct.unpack_iterator",
|
||||
sizeof(unpackiterobject),
|
||||
0,
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
|
||||
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
|
||||
Py_TPFLAGS_IMMUTABLETYPE),
|
||||
unpackiter_type_slots
|
||||
};
|
||||
|
||||
|
|
@ -2110,7 +2111,8 @@ static PyType_Spec PyStructType_spec = {
|
|||
"_struct.Struct",
|
||||
sizeof(PyStructObject),
|
||||
0,
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
|
||||
(Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC |
|
||||
Py_TPFLAGS_BASETYPE | Py_TPFLAGS_IMMUTABLETYPE),
|
||||
PyStructType_slots
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue