-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE
to several internal types
#138582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116946: add Py_TPFLAGS_IMMUTABLETYPE
to several internal types
#138582
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. 👍
This is up to you. |
This only adds the
Py_TPFLAGS_IMMUTABLETYPE
flag 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*api
andxxlimited*
with those that are used in release builds? There is just one type_interpreters.CrossInterpreterBufferView
that I'm unsure of.@pablogsal Am I correct to assume that
_remote_debugging.RemoteUnwinder
should be immutable and is really internal? It's only "publicly" accessible throughprofiling.sampling.SampleProfiler.unwinder
but I don't know if it's meant to be used externally.