From 0b026e53da28a6d5be372f3b59459262be94ff06 Mon Sep 17 00:00:00 2001 From: James Souter Date: Tue, 22 Oct 2024 08:31:56 +0000 Subject: [PATCH] Rollback __hash__ for Device --- src/ophyd_async/core/_device.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ophyd_async/core/_device.py b/src/ophyd_async/core/_device.py index b555412332..92f9ef784a 100644 --- a/src/ophyd_async/core/_device.py +++ b/src/ophyd_async/core/_device.py @@ -129,10 +129,6 @@ async def connect( # Wait for it to complete await self._connect_task - def __hash__(self): - # to allow Devices to be used as dict keys - return hash(id(self)) - DeviceT = TypeVar("DeviceT", bound=Device) @@ -187,7 +183,7 @@ def children(self) -> Iterator[tuple[str, Device]]: for key, child in self._children.items(): yield str(key), child - def __hash__(self): # to allow DeviceVector to be used as dict keys + def __hash__(self): # to allow DeviceVector to be used as dict keys and in sets return hash(id(self))