diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-04-28 17:02:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 17:02:42 (GMT) |
commit | 3b52c8d66b25415f09478ab43f93d59a3547dc13 (patch) | |
tree | c403cd3e2e6601ce86b4732085f0836d278964d9 /Include | |
parent | 3cc481b9de43c234889c8010e7da3af7c0f42319 (diff) | |
download | cpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.zip cpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.tar.gz cpython-3b52c8d66b25415f09478ab43f93d59a3547dc13.tar.bz2 |
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>
Diffstat (limited to 'Include')
-rw-r--r-- | Include/object.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/object.h b/Include/object.h index 695f015..d8476f9 100644 --- a/Include/object.h +++ b/Include/object.h @@ -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) |