René's URL Explorer Experiment


Title: [C API] Replace PyTuple_Pack(1,2) with PyTuple_Make[Single,Pair] to optimize creation of tuples · Issue #140052 · python/cpython · GitHub

Open Graph Title: [C API] Replace PyTuple_Pack(1,2) with PyTuple_Make[Single,Pair] to optimize creation of tuples · Issue #140052 · python/cpython

X Title: [C API] Replace PyTuple_Pack(1,2) with PyTuple_Make[Single,Pair] to optimize creation of tuples · Issue #140052 · python/cpython

Description: Feature or enhancement Proposal: I ran benchmarks on pyperformance and found that tuples with one or two elements account for about 80% of the total. I checked the code and filled the following table with the number of occurrences of one...

Open Graph Description: Feature or enhancement Proposal: I ran benchmarks on pyperformance and found that tuples with one or two elements account for about 80% of the total. I checked the code and filled the following tab...

X Description: Feature or enhancement Proposal: I ran benchmarks on pyperformance and found that tuples with one or two elements account for about 80% of the total. I checked the code and filled the following tab...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C API] Replace PyTuple_Pack(1,2) with PyTuple_Make[Single,Pair] to optimize creation of tuples","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nI ran benchmarks on `pyperformance` and found that tuples with one or two elements account for about 80% of the total.\n\n\u003cimg width=\"841\" height=\"525\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/996243de-ad0b-4843-9879-97e594070e6e\" /\u003e\n\nI checked the code and filled the following table with the number of occurrences of one- and two-element tuples:\n\u003cdetails\u003e\u003csummary\u003eTable with number of occurrences\u003c/summary\u003e\n\n| file                    | function          | count |\n| ----------------------- | ----------------- | ----- |\n| `_asyncmodule.c`        | `PyTuple_New(2)`  | 2     |\n| `_collectionsmodule.c`  | `PyTuple_Pack(1)` | 2     |\n| `_csv.c`                | `PyTuple_Pack(1)` | 1     |\n| `_datetimemodule.c`     | `PyTuple_Pack(2)` | 4     |\n|                         | `PyTuple_Pack(1)` | 3     |\n| `_elementtree.c`        | `PyTuple_Pack(2)` | 4     |\n| `_functoolsmodule.c`    | `PyTuple_New(2)`  | 2     |\n| `_interpretersmodule.c` | `PyTuple_Pack(2)` | 1     |\n| `_json.c`               | `PyTuple_New(2)`  | 1     |\n|                         | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_Pack(1)` | 1     |\n| `_operator.c`           | `PyTuple_Pack(2)` | 1     |\n| `_pickle.c`             | `PyTuple_Pack(2)` | 3     |\n|                         | `PyTuple_New(2)`  | 2     |\n|                         | `PyTuple_New(1)`  | 2     |\n| `_ssl.c`                | `PyTuple_New(2)`  | 6     |\n|                         | `PyTuple_Pack(2)` | 1     |\n| `_threadmodule.c`       | `PyTuple_New(2)`  | 1     |\n| `_tkinter.c`            | `PyTuple_Pack(1)` |       |\n| `arraymodule.c`         | `PyTuple_New(2)`  | 2     |\n| `itertoolsmodule.c`     | `PyTuple_Pack(2)` | 2     |\n|                         | `PyTuple_New(2)`  | 1     |\n| `main.c`                | `PyTuple_Pack(2)` | 1     |\n| `overlapped.c`          | `PyTuple_New(2)`  | 2     |\n| `posixmodule.c`         | `PyTuple_Pack(2)` | 1     |\n| `pyexpat.c`             | `PyTuple_New(1)`  | 1     |\n| `selectmodule.c`        | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_New(2)`  | 1     |\n| `signal_module.c`       | `PyTuple_New(2)`  | 1     |\n| `socket_module.c`       | `PyTuple_Pack(2)` | 3     |\n| `termios.c`             | `PyTuple_New(2)`  | 2     |\n| `_ctypes.c`             | `PyTuple_Pack(2)` | 2     |\n| `stgdict.c`             | `PyTuple_Pack(2)` | 1     |\n| `decimal.c`             | `PyTuple_Pack(2)` | 7     |\n|                         | `PyTuple_Pack(1)` | 2     |\n| `microprotocol.c`       | `PyTuple_Pack(2)` | 2     |\n| `_sre.c`                | `PyTuple_New(2)`  | 1     |\n| `datetime.c`            | `PyTuple_Pack(1)` | 2     |\n|                         | `PyTuple_Pack(2)` | 1     |\n| `getargs.c`             | `PyTuple_Pack(1)` | 1     |\n| `heaptype.c`            | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_Pack(1)` | 2     |\n|                         | `PyTuple_New(2)`  | 1     |\n| `vectorcall_limited.c`  | `PyTuple_New(1)`  | 2     |\n| `multibytecodec.c`      | `PyTuple_New(2)`  | 1     |\n| `codeobject.c`          | `PyTuple_Pack(2)` | 7     |\n| `dictobject.c`          | `PyTuple_Pack(2)` | 2     |\n|                         | `PyTuple_New(2)`  | 4     |\n| `enumobject.c`          | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_New(2)`  | 2     |\n| `exceptions.c`          | `PyTuple_Pack(2)` | 7     |\n| `floatobject.c`         | `PyTuple_Pack(2)` | 1     |\n| `frameobject.c`         | `PyTuple_Pack(2)` | 2     |\n|                         | `PyTuple_Pack(1)` | 1     |\n| `genericaliasobject.c`  | `PyTuple_Pack(1)` | 2     |\n| `listobject.c`          | `PyTuple_Pack(2)` | 1     |\n| `longobject.c`          | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_New(2)`  | 2     |\n| `odictobject.c`         | `PyTuple_Pack(2)` | 2     |\n|                         | `PyTuple_New(2)`  | 1     |\n| `setobject.c`           | `PyTuple_Pack(1)` | 1     |\n| `typeobject.c`          | `PyTuple_Pack(2)` | 2     |\n|                         | `PyTuple_Pack(1)` | 5     |\n| `typevarobject.c`       | `PyTuple_Pack(2)` | 1     |\n|                         | `PyTuple_Pack(1)` | 2     |\n| `unicode_format.h`      | `PyTuple_Pack(2)` | 2     |\n| `pegen_errors.c`        | `PyTuple_Pack(2)` | 2     |\n| `_warnings.c`           | `PyTuple_Pack(2)` | 1     |\n| `bltnmodule.c`          | `PyTuple_Pack(2)` | 1     |\n| `ceval.c`               | `PyTuple_Pack(1)` | 1     |\n| `_codegen.c`            | `PyTuple_Pack(1)` | 2     |\n| `compile.c`             | `PyTuple_Pack(2)` | 1     |\n| `crossinterp.c`         | `PyTuple_Pack(1)` | 1     |\n| `errors.c`              | `PyTuple_Pack(1)` | 1     |\n| `hamt.c`                | `PyTuple_Pack(2)` | 1     |\n| `marshal.c`             | `PyTuple_Pack(2)` | 1     |\n| `pylifecycle.c`         | `PyTuple_Pack(2)` | 1     |\n| `Python-tokenize.c`     | `PyTuple_Pack(2)` | 1     |\n| `sysmodule.c`           | `PyTuple_Pack(1)` | 1     |\n| `tracemalloc.c`         | `PyTuple_New(2)`  | 1     |\n\u003c/details\u003e \n\nI came up with the idea of adding `PyTuple_MakeSingle` and `PyTuple_MakePair` for such cases to improve performance.\n\nAfterwards, @eendebakpt sent me a link with a previous attempt at this (many thanks!) - https://github.com/python/cpython/issues/118222.\n\nAnyway, I implemented these changes and ran benchmarks.\n\nIf we replace `PyTuple_Pack(1,...)` with `PyTuple_MakeSingle` and `PyTuple_Pack(2,...)` with `PyTuple_MakePair` then we get following results (ran on ubuntu 24.04 x64, compiled with lto):\n\u003cdetails\u003e\u003csummary\u003eGeometric mean - 1.00x faster\u003c/summary\u003e\n\n```\n+--------------------------+----------+------------------------+\n| Benchmark                | main     | opt                    |\n+==========================+==========+========================+\n| async_generators         | 277 ms   | 279 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| asyncio_websockets       | 242 ms   | 241 ms: 1.00x faster   |\n+--------------------------+----------+------------------------+\n| chaos                    | 36.0 ms  | 36.6 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| comprehensions           | 10.3 us  | 10.1 us: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| bench_mp_pool            | 66.1 ms  | 43.0 ms: 1.54x faster  |\n+--------------------------+----------+------------------------+\n| coroutines               | 15.0 ms  | 14.5 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| coverage                 | 54.9 ms  | 56.1 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| crypto_pyaes             | 45.3 ms  | 46.1 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| deepcopy                 | 171 us   | 168 us: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| deepcopy_reduce          | 1.87 us  | 1.84 us: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| deepcopy_memo            | 16.5 us  | 17.5 us: 1.06x slower  |\n+--------------------------+----------+------------------------+\n| deltablue                | 1.97 ms  | 1.99 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| django_template          | 23.1 ms  | 23.4 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| docutils                 | 1.70 sec | 1.68 sec: 1.01x faster |\n+--------------------------+----------+------------------------+\n| fannkuch                 | 245 ms   | 243 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| float                    | 42.4 ms  | 43.4 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| gc_traversal             | 2.93 ms  | 2.82 ms: 1.04x faster  |\n+--------------------------+----------+------------------------+\n| generators               | 19.1 ms  | 19.5 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| genshi_text              | 14.2 ms  | 14.4 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| genshi_xml               | 32.8 ms  | 33.1 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| go                       | 68.7 ms  | 70.2 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| hexiom                   | 3.64 ms  | 3.61 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| json_dumps               | 6.34 ms  | 6.26 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| json_loads               | 15.7 us  | 16.1 us: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| logging_silent           | 63.6 ns  | 59.4 ns: 1.07x faster  |\n+--------------------------+----------+------------------------+\n| logging_simple           | 3.49 us  | 3.52 us: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| mako                     | 7.00 ms  | 6.94 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| mdp                      | 788 ms   | 780 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| meteor_contest           | 68.0 ms  | 68.2 ms: 1.00x slower  |\n+--------------------------+----------+------------------------+\n| nbody                    | 55.4 ms  | 55.0 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| pickle_dict              | 18.5 us  | 18.8 us: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| pickle_list              | 2.93 us  | 2.98 us: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| pickle_pure_python       | 208 us   | 205 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| pidigits                 | 143 ms   | 143 ms: 1.00x slower   |\n+--------------------------+----------+------------------------+\n| pprint_safe_repr         | 489 ms   | 496 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| pprint_pformat           | 997 ms   | 1.01 sec: 1.01x slower |\n+--------------------------+----------+------------------------+\n| pyflate                  | 259 ms   | 260 ms: 1.00x slower   |\n+--------------------------+----------+------------------------+\n| regex_compile            | 82.7 ms  | 83.5 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| regex_dna                | 115 ms   | 113 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| regex_v8                 | 14.7 ms  | 14.3 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| richards                 | 27.3 ms  | 27.1 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| richards_super           | 31.2 ms  | 31.1 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| scimark_fft              | 174 ms   | 178 ms: 1.02x slower   |\n+--------------------------+----------+------------------------+\n| scimark_lu               | 71.5 ms  | 69.3 ms: 1.03x faster  |\n+--------------------------+----------+------------------------+\n| scimark_monte_carlo      | 41.9 ms  | 41.2 ms: 1.02x faster  |\n+--------------------------+----------+------------------------+\n| scimark_sor              | 70.4 ms  | 72.0 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| scimark_sparse_mat_mult  | 2.67 ms  | 2.71 ms: 1.02x slower  |\n+--------------------------+----------+------------------------+\n| spectral_norm            | 59.2 ms  | 58.8 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| sqlglot_normalize        | 176 ms   | 179 ms: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| sqlglot_optimize         | 34.0 ms  | 34.1 ms: 1.00x slower  |\n+--------------------------+----------+------------------------+\n| sqlglot_parse            | 801 us   | 792 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| sqlglot_transpile        | 1.01 ms  | 994 us: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| sympy_expand             | 311 ms   | 306 ms: 1.02x faster   |\n+--------------------------+----------+------------------------+\n| sympy_sum                | 92.8 ms  | 92.4 ms: 1.00x faster  |\n+--------------------------+----------+------------------------+\n| sympy_str                | 177 ms   | 176 ms: 1.01x faster   |\n+--------------------------+----------+------------------------+\n| telco                    | 112 ms   | 111 ms: 1.00x faster   |\n+--------------------------+----------+------------------------+\n| tomli_loads              | 1.21 sec | 1.23 sec: 1.02x slower |\n+--------------------------+----------+------------------------+\n| typing_runtime_protocols | 107 us   | 109 us: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| unpack_sequence          | 25.2 ns  | 26.3 ns: 1.04x slower  |\n+--------------------------+----------+------------------------+\n| unpickle_list            | 2.93 us  | 3.01 us: 1.03x slower  |\n+--------------------------+----------+------------------------+\n| unpickle_pure_python     | 137 us   | 138 us: 1.01x slower   |\n+--------------------------+----------+------------------------+\n| xml_etree_iterparse      | 62.9 ms  | 62.0 ms: 1.01x faster  |\n+--------------------------+----------+------------------------+\n| xml_etree_generate       | 54.7 ms  | 55.4 ms: 1.01x slower  |\n+--------------------------+----------+------------------------+\n| xml_etree_process        | 39.0 ms  | 40.3 ms: 1.03x slower  |\n+--------------------------+----------+------------------------+\n| Geometric mean           | (ref)    | 1.00x faster           |\n+--------------------------+----------+------------------------+\n\nBenchmark hidden because not significant (19): 2to3, asyncio_tcp, asyncio_tcp_ssl, bench_thread_pool, dulwich_log, create_gc_cycles, html5lib, logging_format, nqueens, pathlib, pickle, python_startup, python_startup_no_site, raytrace, regex_effbot, sqlite_synth, sympy_integrate, unpickle, xml_etree_parse\n```\n\n\u003c/details\u003e \n\nI plan to implement `PyTuple_Make[Single,Pair]Steal` and also replace `PyTuple_New(1,2)`.\n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-140079\n* gh-140132\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/sergey-miryanov","@type":"Person","name":"sergey-miryanov"},"datePublished":"2025-10-13T16:54:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/140052/cpython/issues/140052"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f3475c3d-9008-fd18-f118-8aeed3e3874c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE30E:B7E00:3E655F:50035F:696B428A
html-safe-noncecc17baeda6333c972540fc855dd5722cc61190cf271afe9149118707a512fd82
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzBFOkI3RTAwOjNFNjU1Rjo1MDAzNUY6Njk2QjQyOEEiLCJ2aXNpdG9yX2lkIjoiMjUzNjI3MjU2MzM3MzAzMjA3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc1e4dd75154632cf6297869e04e19e9b08d9afa9a3cf390714eddbaf12399d61
hovercard-subject-tagissue:3510761200
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/140052/issue_layout
twitter:imagehttps://opengraph.githubassets.com/96b00bd4990377854bdbd0345658bd5db5e3e89baaf0a9997cd7045f58c1ac20/python/cpython/issues/140052
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/96b00bd4990377854bdbd0345658bd5db5e3e89baaf0a9997cd7045f58c1ac20/python/cpython/issues/140052
og:image:altFeature or enhancement Proposal: I ran benchmarks on pyperformance and found that tuples with one or two elements account for about 80% of the total. I checked the code and filled the following tab...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesergey-miryanov
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/140052#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F140052
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F140052
Sign up https://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/140052
Reloadhttps://github.com/python/cpython/issues/140052
Reloadhttps://github.com/python/cpython/issues/140052
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/140052
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/140052
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/140052
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/140052
[C API] Replace PyTuple_Pack(1,2) with PyTuple_Make[Single,Pair] to optimize creation of tupleshttps://github.com/python/cpython/issues/140052#top
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
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/sergey-miryanov
https://github.com/sergey-miryanov
sergey-miryanovhttps://github.com/sergey-miryanov
on Oct 13, 2025https://github.com/python/cpython/issues/140052#issue-3510761200
https://private-user-images.githubusercontent.com/67315/500593056-996243de-ad0b-4843-9879-97e594070e6e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njg2MzczNjcsIm5iZiI6MTc2ODYzNzA2NywicGF0aCI6Ii82NzMxNS81MDA1OTMwNTYtOTk2MjQzZGUtYWQwYi00ODQzLTk4NzktOTdlNTk0MDcwZTZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTE3VDA4MDQyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJiOGYzZTk5YTIwZDFhODVmMGQxNWY3MGUzNTAyY2IwZmY5ZmRjMTc5MDg3ZWEwMjZlYThmMTcxZWJmZjhhMTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.xWGv1V2WtHZUqFTWhRrffAJ7qbfmU9dhJRxUNzxZTcg
@eendebakpthttps://github.com/eendebakpt
#118222https://github.com/python/cpython/issues/118222
GH-140052: Add PyTuple_Make[Single,Pair,Triplet] + steal version #140079https://github.com/python/cpython/pull/140079
GH-140052: Add PyTuple_MakeSingle and PyTuple_MakePair #140132https://github.com/python/cpython/pull/140132
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
performancePerformance or resource usagehttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22performance%22
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.