mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-43916: Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to selected types (GH-25748)
Apply Py_TPFLAGS_DISALLOW_INSTANTIATION to the following types: * _dbm.dbm * _gdbm.gdbm * _multibytecodec.MultibyteCodec * _sre..SRE_Scanner * _thread._localdummy * _thread.lock * _winapi.Overlapped * array.arrayiterator * functools.KeyWrapper * functools._lru_list_elem * pyexpat.xmlparser * re.Match * re.Pattern * unicodedata.UCD * zlib.Compress * zlib.Decompress
This commit is contained in:
parent
387397f8a4
commit
9746cda705
20 changed files with 87 additions and 28 deletions
|
|
@ -546,7 +546,7 @@ static PyType_Slot keyobject_type_slots[] = {
|
|||
static PyType_Spec keyobject_type_spec = {
|
||||
.name = "functools.KeyWrapper",
|
||||
.basicsize = sizeof(keyobject),
|
||||
.flags = Py_TPFLAGS_DEFAULT,
|
||||
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
|
||||
.slots = keyobject_type_slots
|
||||
};
|
||||
|
||||
|
|
@ -766,7 +766,7 @@ static PyType_Slot lru_list_elem_type_slots[] = {
|
|||
static PyType_Spec lru_list_elem_type_spec = {
|
||||
.name = "functools._lru_list_elem",
|
||||
.basicsize = sizeof(lru_list_elem),
|
||||
.flags = Py_TPFLAGS_DEFAULT,
|
||||
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
|
||||
.slots = lru_list_elem_type_slots
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue