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.
__instancecheck__
1 parent 8a633d2 commit 9bc35ffCopy full SHA for 9bc35ff
unification/variable.py
@@ -1,15 +1,19 @@
1
import weakref
2
from abc import ABCMeta
3
-from contextlib import contextmanager, suppress
+from contextlib import contextmanager
4
5
_glv = _global_logic_variables = set()
6
7
8
class LVarType(ABCMeta):
9
def __instancecheck__(self, o):
10
- with suppress(TypeError):
11
- return issubclass(type(o), (Var, LVarType)) or o in _glv
12
- return False
+ if issubclass(type(o), Var):
+ return True
+
13
+ try:
14
+ return o in _glv
15
+ except TypeError:
16
+ return False
17
18
19
class Var(metaclass=LVarType):
0 commit comments