Tin mới
randolf-scholz:improve_protocol_isinstance_perf
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
Performance of typing._ProtocolMeta._get_protocol_attrs and isinstance #74690
added fast check in _ProtocolMeta.__instancecheck__
bedevere-app Bot commented Nov 16, 2023
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.
Learn more about hiding disruptive comments
The reason will be displayed to describe this comment to others. Learn more.
getattr_static is just really slow (I re-ran the test, replacing it with plain getattr and got 11x speedup)