Tin mới
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
Optimise inspect.getattr_static #103193
: cache calls to inspect._shadowed_dict
Use mro tuple as the cache key
Learn more about hiding disruptive comments
The reason will be displayed to describe this comment to others. Learn more.
Add regression test for if a class has its mro mutated(!)
Update perf numbers in whatsnew
https://github.com/python/cpython/pull/103195/files
(Skipping news because, if this patch is correct, it shouldn't change behaviour at all other than improving performance. And the news entry in https://github.com/python/cpython/pull/103195/files should already cover the
[3.12] getattr_static can result in reference leaks #118013
gh-118013: Use weakrefs for the cache key in inspect._shadowed_dict #118202