Skip to content

gh-132604: Deprecate inherited runtime checkability of protocols - #143806

Merged
encukou merged 21 commits into
python:mainfrom
johnslavik:deprecate-inherited-runtime-protocols
Feb 9, 2026
Merged

gh-132604: Deprecate inherited runtime checkability of protocols#143806
encukou merged 21 commits into
python:mainfrom
johnslavik:deprecate-inherited-runtime-protocols

Conversation

@johnslavik

@johnslavikjohnslavik commented Jan 13, 2026

Copy link
Copy Markdown
Member

I've chosen to go ahead with a 5-year deprecation period as Alex told me he'd do at least (thx!).
If this deprecation is too problematic, we can raise the warning eternally / soft deprecate -- and never eventually raise an exception.


📚 Documentation preview 📚: https://cpython-previews--143806.org.readthedocs.build/

No members are added to protocol classes to simplify testing. `issubclass` can only check method members.
@johnslavik
johnslavik marked this pull request as ready for review January 13, 2026 16:08

@JelleZijlstraJelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

Comment threadDoc/library/typing.rst Outdated
Comment threadLib/typing.py Outdated
Comment threadMisc/NEWS.d/next/Library/2026-01-13-15-56-03.gh-issue-132604.lvjNTr.rst Outdated
Comment threadLib/typing.py Outdated
Comment threadDoc/library/typing.rst Outdated
Comment threadLib/typing.py Outdated
johnslavikand others added 2 commits January 19, 2026 16:55
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
…l__`
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@johnslavik

johnslavik commented Jan 19, 2026

Copy link
Copy Markdown
MemberAuthor

I think we can use :deco: for runtime_checkable so I'll do that.
EDIT: Sphinx is a little limited with the markup in this regard; I've applied :deco: in the news entry and that's it.

johnslavikand others added 2 commits January 19, 2026 17:54
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@johnslavik

Copy link
Copy Markdown
MemberAuthor

Merging main to fix CI.

@encukou

Copy link
Copy Markdown
Member

I'll merge on Friday if there are no objections.

@encukou
encukou merged commit ff531f9 into python:mainFeb 9, 2026
47 checks passed
@encukou

Copy link
Copy Markdown
Member

Almost Friday :)

@johnslavik
johnslavik deleted the deprecate-inherited-runtime-protocols branch February 13, 2026 15:02
thunder-coding pushed a commit to thunder-coding/cpython that referenced this pull request Feb 15, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@johnslavik@encukou@JelleZijlstra