Skip to content

Commit

Permalink
Fix eq-without-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Jan 8, 2024
1 parent 452e5eb commit b53806f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ paths_to_mutate = tm/tape.py
[pylint.'MESSAGES CONTROL']
disable =
duplicate-code,
eq-without-hash,
compare-to-zero,
no-name-in-module,
consider-using-in,
Expand Down
2 changes: 1 addition & 1 deletion test/test_turing.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def assert_normal(self, prog: str):
prog)

self.assertTrue(
prog == Program(prog).normalize()
len(prog) == len(Program(prog).normalize())
or prog.startswith('0')
)

Expand Down
3 changes: 3 additions & 0 deletions tm/num.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ def __int__(self) -> int: ...
def __contains__(self, other: Num) -> bool:
return False

@abstractmethod
def __hash__(self) -> int: ...

def estimate(self) -> Count:
est: Exp | Tet

Expand Down
3 changes: 0 additions & 3 deletions tm/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def __setitem__(self, slot: Slot, instr: Instr | None) -> None:

self.prog[state][color] = instr

def __eq__(self, other: object) -> bool:
return str(self) == str(other)

@classmethod
def init(cls, states: int, colors: int) -> Self:
return cls(
Expand Down

0 comments on commit b53806f

Please sign in to comment.