gh-102433: Use `inspect.getattr_static` in `typing._ProtocolMeta.__instancecheck__` by AlexWaygood · Pull Request #103034 · python/cpython · GitHub

github.com

Tin mới

AlexWaygood:runtime-protocols-getattr_static

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

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

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

python/typing#1363

Use getattr_static rather than hasattr in _ProtocolMeta.__instancecheck__, in order to avoid unexpectedly evaluating descriptors and __getattr__ methods in the process of calling isinstance() against runtime-checkable pr

Typing: Document performance pitfalls of protocols decorated with @runtime_checkable #102936

isinstance on runtime_checkable Protocol has side-effects for @property methods #102433

implement winreg QueryValue / SetValue using QueryValueEx / SetValueEx #102344

awaiting core review

awaiting core review

Wrong issue number

Merge branch 'main' into runtime-protocols-getattr_static

gh-74690: typing: Simplify and optimise _ProtocolMeta.__instancecheck__ #103159

gh-74690: Further optimise typing._ProtocolMeta.__instancecheck__ #103280

gh-102433: Use `inspect.getattr_static` in `typing._ProtocolMeta.__instancecheck__` (#103034)

gh-102433: Use `inspect.getattr_static` in `typing._ProtocolMeta.__instancecheck__` (#103034)

Backport performance improvements to runtime-checkable protocols python/typing_extensions#137

Backport use of getattr_static for _ProtocolMeta.__instancecheck__? python/typing_extensions#139

Use inspect.getattr_static in _ProtocolMeta.__instancecheck__ python/typing_extensions#140

[Bug] typing_extensions.Protocol unsupported under typing_extensions ≥ 4.6.0 beartype/beartype#241

typing_extensions >= 4.6.0 causes pip unit test failure tensorflow/tensorflow#60687

runtime checkable protocols potential raising error with custom getattribute #105134

python3-typing-extensions: upgrade 4.5.0 -> 4.6.2

python/cpython#23294

python/cpython#23383

python/cpython#74690

python/cpython#31628

python/cpython#101827

python/cpython#104048

python3-typing-extensions: upgrade 4.5.0 -> 4.6.2

python3-typing-extensions: upgrade 4.5.0 -> 4.6.2

Update dependency typing-extensions to v4.6.3 (

https://github.com/python/cpython/pull/105152](https://togithub.com/python/cpython/pull/105152)l/105152

https://github.com/python/cpython/pull/23294](https://togithub.com/python/cpython/pull/23294)3294

https://github.com/python/cpython/pull/23383](https://togithub.com/python/cpython/pull/23383)ll/23383