Skip to content

Commit 31094f4

Browse files
authored
fixed type identity comparison
1 parent 3430513 commit 31094f4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

unification/variable.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from abc import ABCMeta
33
from contextlib import contextmanager, suppress
44

5-
_global_logic_variables = set()
6-
_glv = _global_logic_variables
5+
_glv = _global_logic_variables = set()
76

87

98
class LVarType(ABCMeta):
@@ -45,7 +44,7 @@ def __new__(cls, token=None, prefix=""):
4544
output.
4645
"""
4746
if token is None:
48-
token = f"{prefix}_{Var._id}"
47+
token = f"{prefix}_{cls._id}"
4948
cls._id += 1
5049

5150
obj = cls._refs.get(token, None)
@@ -63,7 +62,7 @@ def __str__(self):
6362
__repr__ = __str__
6463

6564
def __eq__(self, other):
66-
if type(self) == type(other):
65+
if type(self) is type(other):
6766
return self.token == other.token
6867
return NotImplemented
6968

0 commit comments

Comments
 (0)