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

encukou merged 21 commits into
python:mainfrom
johnslavik:deprecate-inherited-runtime-protocols

Conversation

@johnslavik

@johnslavik johnslavik 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

@JelleZijlstra JelleZijlstra 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 thread Doc/library/typing.rst Resolved
Comment thread Lib/typing.py Resolved
Comment thread Lib/typing.py Resolved
Comment thread Doc/library/typing.rst Resolved
Comment thread Lib/typing.py Resolved
johnslavik and 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
Member Author

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.

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

Copy link
Copy Markdown
Member Author

Merging main to fix CI.

@encukou

encukou commented Feb 4, 2026

Copy link
Copy Markdown
Member

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

@encukou
encukou merged commit ff531f9 into python:main Feb 9, 2026
@encukou

encukou commented Feb 9, 2026

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants