diff options
| author | Guido van Rossum <guido@python.org> | 2016-11-19 10:32:41 -0800 |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 2016-11-19 10:32:41 -0800 |
| commit | ca4b252fba0a0540475f2edebfcabdf80f5cecdf (patch) | |
| tree | 861d6cb50354b5e32b39a6806afe116742fd6c53 /Lib/typing.py | |
| parent | c851817aaa0b1b5e1de6eff7c3c238a49bc970c0 (diff) | |
| download | cpython-git-ca4b252fba0a0540475f2edebfcabdf80f5cecdf.tar.gz | |
Issue #28556: two more small upstream changes by Ivan Levkivskyi (#329, #330)
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 fe22b2b5e8..c7fe5ddb91 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): |
