mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-43908: Add Py_TPFLAGS_IMMUTABLETYPE flag (GH-25520)
Introduce Py_TPFLAGS_IMMUTABLETYPE flag for immutable type objects, and modify PyType_Ready() to set it for static types. Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
3cc481b9de
commit
3b52c8d66b
4 changed files with 24 additions and 1 deletions
|
@ -320,6 +320,9 @@ Code can use PyType_HasFeature(type_ob, flag_value) to test whether the
|
|||
given type object has a specified feature.
|
||||
*/
|
||||
|
||||
/* Set if the type object is immutable: type attributes cannot be set nor deleted */
|
||||
#define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
|
||||
|
||||
/* Set if the type object is dynamically allocated */
|
||||
#define Py_TPFLAGS_HEAPTYPE (1UL << 9)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue