mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to _random.Random (#138341)
This commit is contained in:
parent
dd86fb4ba5
commit
51244ba16a
2 changed files with 10 additions and 5 deletions
|
|
@ -0,0 +1,2 @@
|
|||
The :class:`!_random.Random` C type is now immutable. Patch by Bénédikt
|
||||
Tran.
|
||||
|
|
@ -595,11 +595,14 @@ static PyType_Slot Random_Type_slots[] = {
|
|||
};
|
||||
|
||||
static PyType_Spec Random_Type_spec = {
|
||||
"_random.Random",
|
||||
sizeof(RandomObject),
|
||||
0,
|
||||
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
|
||||
Random_Type_slots
|
||||
.name = "_random.Random",
|
||||
.basicsize = sizeof(RandomObject),
|
||||
.flags = (
|
||||
Py_TPFLAGS_DEFAULT
|
||||
| Py_TPFLAGS_BASETYPE
|
||||
| Py_TPFLAGS_IMMUTABLETYPE
|
||||
),
|
||||
.slots = Random_Type_slots
|
||||
};
|
||||
|
||||
PyDoc_STRVAR(module_doc,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue