René's URL Explorer Experiment


Title: [C API] Add PyBytesWriter API · Issue #121710 · python/cpython · GitHub

Open Graph Title: [C API] Add PyBytesWriter API · Issue #121710 · python/cpython

X Title: [C API] Add PyBytesWriter API · Issue #121710 · python/cpython

Description: Feature or enhancement I propose adding a new PyBytesWriter API to create a Python bytes object. API: typedef struct PyBytesWriter PyBytesWriter; // Create a bytes writer instance. // On success, set *str and return a new writer. // On e...

Open Graph Description: Feature or enhancement I propose adding a new PyBytesWriter API to create a Python bytes object. API: typedef struct PyBytesWriter PyBytesWriter; // Create a bytes writer instance. // On success, s...

X Description: Feature or enhancement I propose adding a new PyBytesWriter API to create a Python bytes object. API: typedef struct PyBytesWriter PyBytesWriter; // Create a bytes writer instance. // On success, s...

Opengraph URL: https://github.com/python/cpython/issues/121710

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C API] Add PyBytesWriter API","articleBody":"# Feature or enhancement\n\nI propose adding a new `PyBytesWriter` API to create a Python bytes object.\n\nAPI:\n\n```c\ntypedef struct PyBytesWriter PyBytesWriter;\n\n// Create a bytes writer instance.\n// On success, set *str and return a new writer.\n// On error, set an exception and return NULLL.\nPyAPI_FUNC(PyBytesWriter*) PyBytesWriter_Create(\n    Py_ssize_t size,\n    char **str);\n\n// Return the final Python bytes object and destroy the writer instance.\n// On success, return a bytes object.\n// On error, set an exception and return NULL.\nPyAPI_FUNC(PyObject *) PyBytesWriter_Finish(\n    PyBytesWriter *writer,\n    char *str);\n\n// Disard a writer: deallocate its memory.\nPyAPI_FUNC(void) PyBytesWriter_Discard(PyBytesWriter *writer);\n\n// Allocate 'size' bytes to prepare writing into writer.\n// On success, return 0.\n// On error, set an exception and return -1.\nPyAPI_FUNC(int) PyBytesWriter_Prepare(\n    PyBytesWriter *writer,\n    char **str,\n    Py_ssize_t size);\n\n// Write a bytes string into writer.\n// On success, return 0.\n// On error, set an exception and return -1.\nPyAPI_FUNC(int) PyBytesWriter_WriteBytes(\n    PyBytesWriter *writer,\n    char **str,\n    const void *bytes,\n    Py_ssize_t size);\n```\n\nThe `PyBytesWriter` *writer* is responsible to manage memor and uses overallocation to be more efficient, *str* is a cursor to write into the bytes string.\n\nThe implementation is based on the existing private `_PyBytesWriter` API which exists for many years and is used by many functions such as ASCII and Latin1 encoders, `binascii` module, `_pickle` module, `_struct` module, bytes methods, etc.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-121726\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2024-07-13T14:30:33Z","url":"https://github.com/python/cpython/issues/121710"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:609a4dc2-1463-9d1a-12e1-a0b086735ce1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC640:313081:16C1F0A:1E08507:6B01FE9C
html-safe-nonce7b7fc1a70f96b96e4ae733ec8dfc19edd625d54c6c3a05450f4a1bc6c06dc897
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjQwOjMxMzA4MToxNkMxRjBBOjFFMDg1MDc6NkIwMUZFOUMiLCJ2aXNpdG9yX2lkIjoiMTg3ODczMzYzNDY4NTUwMTA4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac35563ac9dfcede8e5ce0ed1f75952f96800be238adf0413ac7a301e274c7d227
hovercard-subject-tagissue:2406957836
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/121710/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3491c16de135846f5e2aaf88911932269379af8b80187d435ab79a88cf41d610/python/cpython/issues/121710
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3491c16de135846f5e2aaf88911932269379af8b80187d435ab79a88cf41d610/python/cpython/issues/121710
og:image:altFeature or enhancement I propose adding a new PyBytesWriter API to create a Python bytes object. API: typedef struct PyBytesWriter PyBytesWriter; // Create a bytes writer instance. // On success, s...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/121710#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F121710
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F121710
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/121710
Reloadhttps://github.com/python/cpython/issues/121710
Reloadhttps://github.com/python/cpython/issues/121710
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/121710
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/121710
[C API] Add PyBytesWriter APIhttps://github.com/python/cpython/issues/121710#top
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jul 13, 2024https://github.com/python/cpython/issues/121710#issue-2406957836
gh-121710: Add PyBytesWriter API #121726https://github.com/python/cpython/pull/121726
vstinnerhttps://github.com/vstinner
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
on Jul 13, 2024https://github.com/python/cpython/issues/121710#event-13495586143
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jul 13, 2024https://github.com/python/cpython/issues/121710#issuecomment-2226931794
vstinnerhttps://github.com/vstinner
on Jul 13, 2024https://github.com/python/cpython/issues/121710#event-13496236262
pythongh-121710: Add PyBytesWriter APIhttps://github.com/vstinner/cpython/commit/3405f3a5713b126c85156e1c6bd1b1669556c981
pythongh-121710https://github.com/python/cpython/issues/121710
3405f3ahttps://github.com/vstinner/cpython/commit/3405f3a5713b126c85156e1c6bd1b1669556c981
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jul 13, 2024https://github.com/python/cpython/issues/121710#issuecomment-2227080818
vstinnerhttps://github.com/vstinner
on Jul 13, 2024https://github.com/python/cpython/issues/121710#event-13496260161
pythongh-121710: Add PyBytesWriter APIhttps://github.com/vstinner/cpython/commit/786280894628261d39605079f2319b2d0629c6cc
pythongh-121710https://github.com/python/cpython/issues/121710
7862808https://github.com/vstinner/cpython/commit/786280894628261d39605079f2319b2d0629c6cc
vstinnerhttps://github.com/vstinner
on Jul 27, 2024https://github.com/python/cpython/issues/121710#event-13669450487
pythongh-121710: Add PyBytesWriter APIhttps://github.com/vstinner/cpython/commit/fe9667d149ae1fc1380683b7496a115efea81e76
pythongh-121710https://github.com/python/cpython/issues/121710
fe9667dhttps://github.com/vstinner/cpython/commit/fe9667d149ae1fc1380683b7496a115efea81e76
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Oct 7, 2024https://github.com/python/cpython/issues/121710#issuecomment-2396890945
capi-workgroup/decisions#39 (comment)https://github.com/capi-workgroup/decisions/issues/39#issuecomment-2396888574
vstinnerhttps://github.com/vstinner
not plannedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Oct 7, 2024https://github.com/python/cpython/issues/121710#event-14540415926
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/121710
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/121710
topic-C-APIhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-C-API%22
type-featureA feature request or enhancementhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-feature%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.