Skip to content

Commit

Permalink
Document that typing_extensions.Protocol and typing.Protocol don'…
Browse files Browse the repository at this point in the history
…t always play well together (#246)
  • Loading branch information
AlexWaygood authored Jun 17, 2023
1 parent fd1f853 commit cfd49f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ Special typing primitives
``typing_extensions.Protocol`` simultaneously. Previously, this led to
:py:exc:`TypeError` being raised due to a metaclass conflict.

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

.. data:: Required

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

0 comments on commit cfd49f8

Please sign in to comment.