GitHub CopilotWrite better code with AI | MCP RegistryIntegrate external tools | ActionsAutomate any workflow | CodespacesInstant dev environments | IssuesPlan and track work | Code ReviewManage code changes | Code QualityEnforce quality at merge | Why GitHub | Marketplace | View all features | Enterprises | Small and medium teams | Startups | View all use cases | View all industries | View all solutions | AI | Software Development | DevOps | Security | View all topics | Customer stories | Events & webinars | Ebooks & reports | Business insights | Trust center | Partners | View all resources
Tin mới
Fidget-Spinner:specialize_py_class_calls
GitHub CopilotWrite better code with AI
GitHub Copilot appDirect agents from issue to merge
CodespacesInstant dev environments
Code ReviewManage code changes
Code QualityEnforce quality at merge
GitHub Advanced SecurityFind and fix vulnerabilities
Code securitySecure your code as you build
Secret protectionStop leaks before they start
GitHub SponsorsFund open source developers
Copilot for BusinessEnterprise-grade AI features
Premium SupportEnterprise-grade 24/7 support
Specialize calls to Python classes
faster-cpython/ideas#267 (comment)
I nearly went insane writing and debugging this. The general idea follows Mark's comments in faster-cpython/ideas#267 (comment). However, since we're specializing __init__, we need to return self instead of the None that
Fix segfaults, refleaks, readjust sys tests size
Learn more about hiding disruptive comments
The reason will be displayed to describe this comment to others. Learn more.
fix refleak on frame exit due to exception
Use non-function pointer since it's faster
Address Jelle's review (use vectorcall for new)
_PyObject_New_Vector does some argument checking. https://github.com/python/cpython/pull/31707/files#diff-1decebeef15f4e0b0ce106c665751ec55068d4d1d1825847925ad4f528b5b872R4525
This feels a bit fragile to me, but it is an interesting alternative to my approach of pushing an additional cleanup frame (https://github.com/python/cpython/compare/main...faster-cpython:specialize-calls-to-normal-pytho
Address Mark's reviews (remove func version check)
Merge remote-tracking branch 'upstream/main' into specialize_py_class…
Merge remote-tracking branch 'upstream/main' into specialize_py_class…
Drop generators from specialization
https://github.com/python/cpython
Specialize calls for Python classes #91095