From 150ada283afc5450f37433dd4f42f2d22dbd6f67 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sat, 17 Jun 2023 15:11:34 +0100 Subject: [PATCH 1/2] Document that `typing_extensions.Protocol` and `typing.Protocol` don't always play well together --- doc/index.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index 756d1842..9f3fd235 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -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. From 98d30d72c264a2aef4ce6437474e01acc5f1d946 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Sat, 17 Jun 2023 21:00:34 +0100 Subject: [PATCH 2/2] Update doc/index.rst --- doc/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/index.rst b/doc/index.rst index 9f3fd235..5fd2b2e8 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -307,7 +307,7 @@ Special typing primitives 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 + present in a protocol class's :py:term:`method resolution order`. See :issue:`245` for some examples. .. data:: Required