Skip to content

Commit cfd49f8

Browse files
authored
Document that typing_extensions.Protocol and typing.Protocol don't always play well together (#246)
1 parent fd1f853 commit cfd49f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/index.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ Special typing primitives
304304
``typing_extensions.Protocol`` simultaneously. Previously, this led to
305305
:py:exc:`TypeError` being raised due to a metaclass conflict.
306306

307+
It is recommended to avoid doing this if possible. Not all features and
308+
bugfixes that ``typing_extensions.Protocol`` backports from newer Python
309+
versions are guaranteed to work if :py:class:`typing.Protocol` is also
310+
present in a protocol class's :py:term:`method resolution order`. See
311+
:issue:`245` for some examples.
312+
307313
.. data:: Required
308314

309315
See :py:data:`typing.Required` and :pep:`655`. In ``typing`` since 3.11.

0 commit comments

Comments
 (0)