Skip to content

Commit 777f477

Browse files
committed
pythongh-103171: Document behaviour change in 3.11 for runtime-checkable protocols decorated with @final
1 parent 848bdbe commit 777f477

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Doc/library/typing.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,13 @@ These are not used in annotations. They are building blocks for creating generic
16191619

16201620
.. versionadded:: 3.8
16211621

1622+
.. versionchanged:: 3.11
1623+
Where a runtime-checkable protocol class ``X`` is decorated with
1624+
:func:`@typing.final <typing.final>`, an object ``y`` will now only be
1625+
considered an instance of ``X`` if the class of ``y`` is also decorated
1626+
with ``@final``. Runtime-checkable protocols decorated with ``@final``
1627+
can also no longer be used in :func:`issubclass` calls.
1628+
16221629
Other special directives
16231630
""""""""""""""""""""""""
16241631

0 commit comments

Comments
 (0)