gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types#138582
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types#138582picnixz merged 10 commits intopython:mainfrom
Py_TPFLAGS_IMMUTABLETYPE to several internal types#138582Conversation
970baf2 to
6405c1c
Compare
Yes 👍
Is also accessible via |
Yes. I wondered whether a NEWS entry was needed or not but considering it's (1) a really internal type (2) the RemoteUnwinder type and its instances are not directly accessible by the end user (or would it be possible later?), I will not write a NEWS entry for the unwinder type. The rationale why the other types were documented is because I can access them with public functions directly, e.g., |
For now is strictly private and not intented for direct usage, just via different parts of the standard library that are in turn user visible. |
This is up to you. |
This only adds the
Py_TPFLAGS_IMMUTABLETYPEflag and assumes that other GC-related issues are solved (not all types are actually empty). I've added NEWS entries just because we also mention transforming extension modules from single-phase to multi-phase. It doesn't hurt mentioning this if a type can be observed withobj = public_func(); print(type(obj)).@serhiy-storchaka Can I split the PR for immutable types into those that are in
_test*apiandxxlimited*with those that are used in release builds? There is just one type_interpreters.CrossInterpreterBufferViewthat I'm unsure of.@pablogsal Am I correct to assume that
_remote_debugging.RemoteUnwindershould be immutable and is really internal? It's only "publicly" accessible throughprofiling.sampling.SampleProfiler.unwinderbut I don't know if it's meant to be used externally.