We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cac70c commit 01d7f9bCopy full SHA for 01d7f9b
pep-0544.txt
@@ -770,7 +770,7 @@ A class object is considered an implementation of a protocol if accessing
770
all members on it results in types compatible with the protocol members.
771
For example::
772
773
- from typing import Any, Protocol
+ from typing import Any, Protocol, Type
774
775
class ProtoA(Protocol):
776
def meth(self, x: int) -> int: ...
@@ -780,8 +780,8 @@ For example::
780
class C:
781
782
783
- a: ProtoA = C # Type check error, signatures don't match!
784
- b: ProtoB = C # OK
+ a: Type[ProtoA] = C # OK
+ b: Type[ProtoB] = C # Type check error, signatures don't match!
785
786
787
``NewType()`` and type aliases
0 commit comments