Fix typing issues found using Pyrefly in folding_input and its test

PiperOrigin-RevId: 914762494
Change-Id: I5c088e81b7fb7c7c2b136c7c6882175f23ed000c
This commit is contained in:
Augustin Zidek
2026-05-13 03:29:07 -07:00
committed by Copybara-Service
parent 9ea7db2d3b
commit 9556a1c9da

View File

@@ -112,7 +112,9 @@ class Template:
def __hash__(self) -> int:
return hash((self._mmcif, tuple(sorted(self._query_to_template))))
def __eq__(self, other: Self) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, Template):
return NotImplemented
mmcifs_equal = self._mmcif == other._mmcif
maps_equal = sorted(self._query_to_template) == sorted(
other._query_to_template
@@ -221,7 +223,9 @@ class ProteinChain:
def __len__(self) -> int:
return len(self._sequence)
def __eq__(self, other: Self) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, ProteinChain):
return NotImplemented
return (
self._id == other._id
and self._sequence == other._sequence
@@ -520,7 +524,9 @@ class RnaChain:
def __len__(self) -> int:
return len(self._sequence)
def __eq__(self, other: Self) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, RnaChain):
return NotImplemented
return (
self._id == other._id
and self._sequence == other._sequence
@@ -705,7 +711,9 @@ class DnaChain:
def __len__(self) -> int:
return len(self._sequence)
def __eq__(self, other: Self) -> bool:
def __eq__(self, other: object) -> bool:
if not isinstance(other, DnaChain):
return NotImplemented
return (
self._id == other._id
and self._sequence == other._sequence