FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-116946: add `Py_TPFLAGS_IMMUTABLETYPE` to several internal types by picnixz · Pull Request #138582 · python/cpython · GitHub

/ cpython Public

gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types - #138582

Merged
picnixz merged 10 commits into
python:mainfrom
picnixz:feat/gc/immutable-heap-types-116946
Sep 11, 2025
Merged

gh-116946: add Py_TPFLAGS_IMMUTABLETYPE to several internal types#138582
picnixz merged 10 commits into
python:mainfrom
picnixz:feat/gc/immutable-heap-types-116946

Conversation

picnixz commented Sep 6, 2025
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

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 with obj = public_func(); print(type(obj)).

@serhiy-storchaka Can I split the PR for immutable types into those that are in _test*api and xxlimited* 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 through profiling.sampling.SampleProfiler.unwinder but I don't know if it's meant to be used externally.

picnixz force-pushed the feat/gc/immutable-heap-types-116946 branch from 970baf2 to 6405c1c Compare September 6, 2025 13:59

pablogsal commented Sep 6, 2025
edited
Loading

Copy link
Copy Markdown
Member

@pablogsal Am I correct to assume that _remote_debugging.RemoteUnwinder should be immutable and is really internal?

Yes 👍

It's only "publicly" accessible through profiling.sampling.SampleProfiler.unwinder but I don't know if it's meant to be used externally.

Is also accessible via Lib/asyncio/tools.py. What do you mean with externally? By end users?

picnixz commented Sep 6, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

By end users?

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., zlib.Compress is obtained by zlib.compressobj(). But for RemoteUnwinder, you need a bit more work to access an instance of that type.

Copy link
Copy Markdown
Member

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.

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.

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. 👍

Copy link
Copy Markdown
Member

Can I split the PR for immutable types into those that are in _test*api and xxlimited* with those that are used in release builds?

This is up to you.

picnixz merged commit 4978bfc into python:main Sep 11, 2025
49 checks passed
picnixz deleted the feat/gc/immutable-heap-types-116946 branch September 11, 2025 07:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL