summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2016-11-19 18:32:44 (GMT)
committerGuido van Rossum <guido@python.org>2016-11-19 18:32:44 (GMT)
commit6e3f34b6b67db8ef28a42b057f34ca6ddaede377 (patch)
tree0605ccbfbcc9f1a8bd07be9671b3064362deaa89 /Lib/typing.py
parent002d61fea7ec026f80bef8b3259681454c1731f0 (diff)
parent43891e0a53cc7057ec4e2080f6296c20ea676a98 (diff)
downloadcpython-6e3f34b6b67db8ef28a42b057f34ca6ddaede377.zip
cpython-6e3f34b6b67db8ef28a42b057f34ca6ddaede377.tar.gz
cpython-6e3f34b6b67db8ef28a42b057f34ca6ddaede377.tar.bz2
Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330) (3.6->3.7)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index fe22b2b..c7fe5dd 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1503,6 +1503,8 @@ class _ProtocolMeta(GenericMeta):
"""
def __instancecheck__(self, obj):
+ if _Protocol not in self.__bases__:
+ return super().__instancecheck__(obj)
raise TypeError("Protocols cannot be used with isinstance().")
def __subclasscheck__(self, cls):