gh-102433: Add tests for how classes with properties interact with `isinstance()` checks on `typing.runtime_checkable` protocols by AlexWaygood · Pull Request #102449 · python/cpython · GitHub

github.com

Tin mới

AlexWaygood:runtime-checkable-tests

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

It appears we currently have no tests for how classes with properties interact with isinstance checks for protocols decorated with @runtime_checkable.

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

: Add tests for how properties interact with `typing.r…

needs backport to 3.10

needs backport to 3.10

needs backport to 3.11

needs backport to 3.11

awaiting core review

awaiting core review

View reviewed changes

Don't assert undesirable behaviour; cover other situations too

View reviewed changes

Update Lib/test/test_typing.py

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

View reviewed changes

Update Lib/test/test_typing.py

: Add tests for how classes with properties interact w…

: Add tests for how classes with properties interact w…

: Add tests for how classes with properties interact with `i…

: Add tests for how classes with properties interact with `i…

: Add tests for how classes with properties interact w…

Backport test coverage improvements for runtime-checkable protocols python/typing_extensions#136