René's URL Explorer Experiment


Title: [C API] Add PyLong_FromInt64() and PyLong_ToInt64() · Issue #120389 · python/cpython · GitHub

Open Graph Title: [C API] Add PyLong_FromInt64() and PyLong_ToInt64() · Issue #120389 · python/cpython

X Title: [C API] Add PyLong_FromInt64() and PyLong_ToInt64() · Issue #120389 · python/cpython

Description: Feature or enhancement I propose to add functions to convert integers to/from Python int objects: PyObject* PyLong_FromInt32(int32_t value); PyObject* PyLong_FromInt64(int64_t value); PyObject* PyLong_FromUInt32(uint32_t value...

Open Graph Description: Feature or enhancement I propose to add functions to convert integers to/from Python int objects: PyObject* PyLong_FromInt32(int32_t value); PyObject* PyLong_FromInt64(int64_t value); Py...

X Description: Feature or enhancement I propose to add functions to convert <stdint.h> integers to/from Python int objects: PyObject* PyLong_FromInt32(int32_t value); PyObject* PyLong_FromInt64(int64_t valu...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C API] Add PyLong_FromInt64() and PyLong_ToInt64()","articleBody":"# Feature or enhancement\r\n\r\nI propose to add functions to convert \u003cstdint.h> integers to/from Python int objects:\r\n\r\n```c\r\nPyObject* PyLong_FromInt32(int32_t value);\r\nPyObject* PyLong_FromInt64(int64_t value);\r\nPyObject* PyLong_FromUInt32(uint32_t value);\r\nPyObject* PyLong_FromUInt64(uint64_t value);\r\n\r\nint PyLong_ToInt32(PyObject *obj, int32_t *value);\r\nint PyLong_ToInt64(PyObject *obj, int64_t *value);\r\nint PyLong_ToUInt32(PyObject *obj, uint32_t *value);\r\nint PyLong_ToUInt64(PyObject *obj, uint64_t *value);\r\n```\r\n\r\nNotes:\r\n\r\n* I prefer to limit the API to 4 types for now: int32/64_t and uint32/64_t. Later, we can discuss add more types, but let's start with the most common ones. (**UPDATE:** I removed 8-bit and 16-bit types.)\r\n* I prefer `UInt` to `Uint` since there are two words: Unsigned INTeger.\r\n* `To` functions don't return the result, but a status: 0 on success, -1 on error (with an exception set). It's to solve the [C API Problem #1](https://github.com/capi-workgroup/problems/issues/1): \"Ambiguous return values\". PyLong_AsLong() returns -1 on success and on error (with an exception set).\r\n\r\nRelated discussion: [Avoid C-specific Types](https://github.com/capi-workgroup/api-evolution/issues/10).\r\n\r\n\u003c!-- gh-linked-prs -->\r\n### Linked PRs\r\n* gh-120390\r\n\u003c!-- /gh-linked-prs -->\r\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2024-06-12T07:55:06Z","url":"https://github.com/python/cpython/issues/120389"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4312f665-3d97-4d0c-e075-499aa8047553
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD838:36534B:28E704:3931FE:6AECB65C
html-safe-nonce51367370ef3a9f6db505afbffb5f14fc662127abba410c9176b7f421a62faabe
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODM4OjM2NTM0QjoyOEU3MDQ6MzkzMUZFOjZBRUNCNjVDIiwidmlzaXRvcl9pZCI6IjYyMzEzODI1ODE5ODc1NTQ5MDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9d47a97a999ce4699d8868e9f0dae239a8135ff24a8686ce7b2a1dda81ac2e5e
hovercard-subject-tagissue:2348085250
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/120389/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ace12913b02ce70936ef81b97b2955d573c386755418638a43613e739b0e91b/python/cpython/issues/120389
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ace12913b02ce70936ef81b97b2955d573c386755418638a43613e739b0e91b/python/cpython/issues/120389
og:image:altFeature or enhancement I propose to add functions to convert integers to/from Python int objects: PyObject* PyLong_FromInt32(int32_t value); PyObject* PyLong_FromInt64(int64_t value); Py...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None95ae5445dec4cded2bc4f9d97ede92b9116c0bf381a08a5c844b60b5bddcbc97
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
releasedb4ef601a7f034ae2a68e17d6eeaeb7ee9470192
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/120389#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F120389
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%2F120389
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/120389
Reloadhttps://github.com/python/cpython/issues/120389
Reloadhttps://github.com/python/cpython/issues/120389
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.3k (2.3k)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/pulse
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/120389
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/120389
[C API] Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/python/cpython/issues/120389#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 Jun 12, 2024https://github.com/python/cpython/issues/120389#issue-2348085250
C API Problem #1https://github.com/capi-workgroup/problems/issues/1
Avoid C-specific Typeshttps://github.com/capi-workgroup/api-evolution/issues/10
gh-120389: Add PyLong_FromInt64() and PyLong_AsInt64() #120390https://github.com/python/cpython/pull/120390
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 Jun 12, 2024https://github.com/python/cpython/issues/120389#event-13127581995
vstinnerhttps://github.com/vstinner
on Jun 12, 2024https://github.com/python/cpython/issues/120389#event-13127865690
pythongh-120389: Add PyLong_FromInt64() and PyLong_AsInt64()https://github.com/vstinner/cpython/commit/14a06354db57bac26324a4145c10241c6fd61af7
pythongh-120389https://github.com/python/cpython/issues/120389
14a0635https://github.com/vstinner/cpython/commit/14a06354db57bac26324a4145c10241c6fd61af7
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2162394520
@encukouhttps://github.com/encukou
@serhiy-storchakahttps://github.com/serhiy-storchaka
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2162399527
#117031https://github.com/python/cpython/issues/117031
#117032https://github.com/python/cpython/pull/117032
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2162412377
#117031https://github.com/python/cpython/issues/117031
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2162459413
https://devguide.python.org/developer-workflow/c-api/index.html#guidelines-for-expanding-changing-the-public-apihttps://devguide.python.org/developer-workflow/c-api/index.html#guidelines-for-expanding-changing-the-public-api
https://github.com/GalaxySnail
GalaxySnailhttps://github.com/GalaxySnail
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2162626801
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Jun 12, 2024https://github.com/python/cpython/issues/120389#issuecomment-2163259379
https://devguide.python.org/developer-workflow/c-api/index.html#guidelines-for-expanding-changing-the-public-apihttps://devguide.python.org/developer-workflow/c-api/index.html#guidelines-for-expanding-changing-the-public-api
vstinnerhttps://github.com/vstinner
on Jun 17, 2024https://github.com/python/cpython/issues/120389#event-13191117996
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 17, 2024https://github.com/python/cpython/issues/120389#issuecomment-2174332921
vstinnerhttps://github.com/vstinner
on Jun 19, 2024https://github.com/python/cpython/issues/120389#event-13217541072
pythongh-120389: Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/vstinner/cpython/commit/00318ffe4e8e56efeae01e888428e32bbfa2c9a2
pythongh-120389https://github.com/python/cpython/issues/120389
00318ffhttps://github.com/vstinner/cpython/commit/00318ffe4e8e56efeae01e888428e32bbfa2c9a2
pythongh-120389: Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/vstinner/cpython/commit/2825e6f2a0f9d6ff091c5fd0ffbb1f7aa000388d
pythongh-120389https://github.com/python/cpython/issues/120389
2825e6fhttps://github.com/vstinner/cpython/commit/2825e6f2a0f9d6ff091c5fd0ffbb1f7aa000388d
pythongh-120389: Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/vstinner/cpython/commit/93e27a11d7174aa47d4292efb427ad11acea2271
pythongh-120389https://github.com/python/cpython/issues/120389
93e27a1https://github.com/vstinner/cpython/commit/93e27a11d7174aa47d4292efb427ad11acea2271
pythongh-120389: Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/vstinner/cpython/commit/684360efe11fbe5f139fe484c4f1d352eb6f59fc
pythongh-120389https://github.com/python/cpython/issues/120389
684360ehttps://github.com/vstinner/cpython/commit/684360efe11fbe5f139fe484c4f1d352eb6f59fc
pythongh-120389: Add PyLong_FromInt64() and PyLong_ToInt64()https://github.com/vstinner/cpython/commit/3e50341c49bc654b6ed15cf0e7b7b0eec3c3637e
pythongh-120389https://github.com/python/cpython/issues/120389
3e50341https://github.com/vstinner/cpython/commit/3e50341c49bc654b6ed15cf0e7b7b0eec3c3637e
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 20, 2024https://github.com/python/cpython/issues/120389#issuecomment-2181369838
@serhiy-storchakahttps://github.com/serhiy-storchaka
#120390https://github.com/python/cpython/pull/120390
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 24, 2024https://github.com/python/cpython/issues/120389#issuecomment-2186454902
capi-workgroup/decisions#32https://github.com/capi-workgroup/decisions/issues/32
vstinnerhttps://github.com/vstinner
on Aug 28, 2024https://github.com/python/cpython/issues/120389#event-14044109157
gh-120389: Add PyLong_FromInt64() and PyLong_AsInt64() (#120390)https://github.com/python/cpython/commit/4c6dca82925bd4be376a3e4a53c8104ad0b0cb5f
gh-120389https://github.com/python/cpython/issues/120389
#120390https://github.com/python/cpython/pull/120390
4c6dca8https://github.com/python/cpython/commit/4c6dca82925bd4be376a3e4a53c8104ad0b0cb5f
vstinnerhttps://github.com/vstinner
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Aug 28, 2024https://github.com/python/cpython/issues/120389#event-14046249930
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/120389
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/120389
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.