diff options
author | Guido van Rossum <guido@python.org> | 2016-11-19 18:32:43 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2016-11-19 18:32:43 (GMT) |
commit | 43891e0a53cc7057ec4e2080f6296c20ea676a98 (patch) | |
tree | 1ea8be78b0bb3148feea6e9bc54434021f1280d9 /Lib/typing.py | |
parent | ec5d3cd533be223248a77a881f584e64f4777646 (diff) | |
parent | ca4b252fba0a0540475f2edebfcabdf80f5cecdf (diff) | |
download | cpython-43891e0a53cc7057ec4e2080f6296c20ea676a98.zip cpython-43891e0a53cc7057ec4e2080f6296c20ea676a98.tar.gz cpython-43891e0a53cc7057ec4e2080f6296c20ea676a98.tar.bz2 |
Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330) (3.5->3.6)
Diffstat (limited to 'Lib/typing.py')
-rw-r--r-- | Lib/typing.py | 2 |
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): |