8000 gh-103171: Document and test behaviour change in 3.11 for runtime-checkable protocols decorated with `@final` by AlexWaygood · Pull Request #103173 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-103171: Document and test behaviour change in 3.11 for runtime-checkable protocols decorated with @final #103173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-103171: Document behaviour change in 3.11 for runtime-checkable pr…
…otocols decorated with `@final`
  • Loading branch information
AlexWaygood committed Apr 1, 2023
commit 777f477e684b56e49b51922dd82f5187fec136bd
7 changes: 7 additions & 0 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,13 @@ These are not used in annotations. They are building blocks for creating generic

.. versionadded:: 3.8

.. versionchanged:: 3.11
Where a runtime-checkable protocol class ``X`` is decorated with
:func:`@typing.final <typing.final>`, an object ``y`` will now only be
considered an instance of ``X`` if the class of ``y`` is also decorated
with ``@final``. Runtime-checkable protocols decorated with ``@final``
can also no longer be used in :func:`issubclass` calls.

Other special directives
""""""""""""""""""""""""

Expand Down
0