Skip to content

[3.13] gh-83731: Test that isinstance() ignores tuple subclass methods (GH-158000) - #159565

Closed
vasiliyk wants to merge 1 commit into
python:3.13from
vasiliyk:backport-isinstance-3.13
Closed

vasiliyk wants to merge 1 commit into
python:3.13from
vasiliyk:backport-isinstance-3.13

Conversation

@vasiliyk

@vasiliyk vasiliyk commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Manual backport of #158000 to 3.13.

The conflict was only in the surrounding context of Lib/test/test_isinstance.py.
cc @methane

…python#158000)

Add a regression test to make sure isinstance() reads the items of a
tuple subclass directly, without calling its __iter__(), __getitem__()
or __len__().

(cherry picked from commit 21a36aa)
@vasiliyk

Copy link
Copy Markdown
Contributor Author

The test is a guard against future regressions and does not need backporting.

@vasiliyk vasiliyk closed this Oct 17, 2026
@vasiliyk
vasiliyk deleted the backport-isinstance-3.13 branch October 17, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant