diff --git a/python/lsst/daf/butler/_butler_collections.py b/python/lsst/daf/butler/_butler_collections.py index 969c05f55d..418a465ed5 100644 --- a/python/lsst/daf/butler/_butler_collections.py +++ b/python/lsst/daf/butler/_butler_collections.py @@ -31,7 +31,7 @@ from abc import ABC, abstractmethod from collections.abc import Iterable, Sequence, Set -from typing import Any, overload +from typing import overload from pydantic import BaseModel @@ -68,12 +68,6 @@ def __getitem__(self, index: int | slice) -> str | Sequence[str]: def __len__(self) -> int: return len(self.defaults) - def __eq__(self, other: Any) -> bool: - # Do not try to compare registry instances. - if not isinstance(other, type(self)): - return False - return self.defaults == other.defaults - @property @abstractmethod def defaults(self) -> Sequence[str]: diff --git a/tests/test_butler.py b/tests/test_butler.py index f29a3148ae..92604ada75 100644 --- a/tests/test_butler.py +++ b/tests/test_butler.py @@ -1092,7 +1092,7 @@ def testPickle(self) -> None: butlerOut = pickle.loads(pickle.dumps(butler)) self.assertIsInstance(butlerOut, Butler) self.assertEqual(butlerOut._config, butler._config) - self.assertEqual(butlerOut.collections, butler.collections) + self.assertEqual(list(butlerOut.collections.defaults), list(butler.collections.defaults)) self.assertEqual(butlerOut.run, butler.run) def testGetDatasetTypes(self) -> None: