MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / __eq__

Method __eq__

lean_py/marshal.py:273–286  ·  view source on GitHub ↗
(self, other: object)

Source from the content-addressed store, hash-verified

271 return f"{self._type_name}.{self.ctor}({', '.join(repr(f) for f in self.fields)})"
272
273 def __eq__(self, other: object) -> bool:
274 if isinstance(other, LeanInductiveValue):
275 return (self._type_name, self.tag, self.fields) == (
276 other._type_name,
277 other.tag,
278 other.fields,
279 )
280 if type(other) is _CtorMeta:
281 return (
282 self._type_name == other._type_name # type: ignore[attr-defined]
283 and self.ctor == other._ctor_name # type: ignore[attr-defined]
284 and self.fields == ()
285 )
286 return NotImplemented
287
288 def __hash__(self) -> int:
289 return hash((self._type_name, self.tag, self.fields))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected