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

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

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
47 checks passed
@encukou

encukou commented Feb 9, 2026

Copy link
Copy Markdown
Member

Almost Friday :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants