Title: [C API] Add `PyFrozenWriter` C API to create a `frozenset` object · Issue #160147 · python/cpython · GitHub
Open Graph Title: [C API] Add `PyFrozenWriter` C API to create a `frozenset` object · Issue #160147 · python/cpython
X Title: [C API] Add `PyFrozenWriter` C API to create a `frozenset` object · Issue #160147 · python/cpython
Description: In the current C API, PyFrozenSet_New(iterable) allows creating a frozenset object from an iterable object. This API is nice, but it doesn't cover all use cases. For other use cases, PySet_Add(frozenset, item) can be called to modify an ...
Open Graph Description: In the current C API, PyFrozenSet_New(iterable) allows creating a frozenset object from an iterable object. This API is nice, but it doesn't cover all use cases. For other use cases, PySet_Add(froz...
X Description: In the current C API, PyFrozenSet_New(iterable) allows creating a frozenset object from an iterable object. This API is nice, but it doesn't cover all use cases. For other use cases, PySet_Add(...
Opengraph URL: https://github.com/python/cpython/issues/160147
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C API] Add `PyFrozenWriter` C API to create a `frozenset` object","articleBody":"In the current C API, `PyFrozenSet_New(iterable)` allows creating a `frozenset` object from an iterable object. This API is nice, but it doesn't cover all use cases.\n\nFor other use cases, `PySet_Add(frozenset, item)` can be called to **modify an immutable** frozenset which is a bit unfortunate, since frozenset objects are supposed to be immutable. Examples of functions creating an immutable frozenset using `PySet_Add()`:\n\n* Modules/_abc.c: `compute_abstract_methods()` for *abstract*\n* Modules/_ssl.c: `parseKeyUsage()` for *retval*\n* Modules/_asynciomodule.c: `_asyncio.Future._asyncio_awaited_by`\n* Modules/_hashopenssl.c: `hashlib_md_meth_names()` for *state.set*\n* Modules/marshal.c: `r_object()`\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-160154\n* gh-161189\n* gh-161191\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-10-21T23:19:51Z","url":"https://github.com/python/cpython/issues/160147"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:079e53fe-dae1-6285-f05a-b2bd21fca9c9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7E8:1F95:EEDFF:1838BC:6B023A98 |
| html-safe-nonce | 0f6f28e57e86e8e03dd1068f66e81b9d59afde4a688e0544fa8bc6e42de91f5b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0U4OjFGOTU6RUVERkY6MTgzOEJDOjZCMDIzQTk4IiwidmlzaXRvcl9pZCI6IjE4OTI0MDYxMDkwMjE1NTEyNTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e479d889b8119bd09dfe28613825a5dc7b162df8b6b52fb12c6464d1d1df38a2 |
| hovercard-subject-tag | issue:5970101213 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/160147/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ef7c398b6c222627c5d0fbd1820dab203704b9dccc36a5c5dcf6bf12c9137a49/python/cpython/issues/160147 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ef7c398b6c222627c5d0fbd1820dab203704b9dccc36a5c5dcf6bf12c9137a49/python/cpython/issues/160147 |
| og:image:alt | In the current C API, PyFrozenSet_New(iterable) allows creating a frozenset object from an iterable object. This API is nice, but it doesn't cover all use cases. For other use cases, PySet_Add(froz... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width