Skip to content

Commit 599d41a

Browse files
authored
Update protocol.rst
1 parent 5d3c1f8 commit 599d41a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/spec/protocol.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ from regular ABCs, where abstractness is simply defined by having at least one
257257
abstract method being unimplemented. Protocol classes must be marked
258258
*explicitly*.
259259

260+
.. _`generic-protocols`:
260261

261262
Generic protocols
262263
^^^^^^^^^^^^^^^^^
@@ -271,7 +272,8 @@ non-protocol generic types::
271272
...
272273

273274
``Protocol[T, S, ...]`` is allowed as a shorthand for
274-
``Protocol, Generic[T, S, ...]``.
275+
``Protocol, Generic[T, S, ...]``. It is an error to include both
276+
``Protocol[T, S, ...]`` and ``Generic[T, S, ...]`` in a class definition.
275277

276278
User-defined generic protocols support explicitly declared variance.
277279
Type checkers will warn if the inferred variance is different from

0 commit comments

Comments
 (0)