Skip to content

Commit 0b8580d

Browse files
committed
Keep subscription surface module-owned
1 parent a7271ca commit 0b8580d

3 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/objectstate/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,7 @@
222222

223223

224224
# Object state management
225-
from objectstate.object_state_registry import (
226-
ObjectStateRegistry,
227-
ObjectStateRegistrySubscription,
228-
)
225+
from objectstate.object_state_registry import ObjectStateRegistry
229226
from objectstate.object_state import ObjectState
230227
from objectstate.object_state_metadata import (
231228
ObjectStateMetadataContract,
@@ -262,7 +259,6 @@
262259
# Object state
263260
'ObjectState',
264261
'ObjectStateRegistry',
265-
'ObjectStateRegistrySubscription',
266262
'ObjectStateMetadataContract',
267263
'ObjectStateMetadataContractRegistry',
268264
'ObjectStateMetadataStore',

src/objectstate/object_state_registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def remove_history_changed_callback(cls, callback: Callable[[], None]) -> bool:
227227
@classmethod
228228
def _subscribe_callback(
229229
cls,
230-
callbacks: List[RegistryCallback],
230+
callbacks: list[RegistryCallback],
231231
callback: RegistryCallback,
232232
) -> ObjectStateRegistrySubscription:
233233
if callback in callbacks:
@@ -239,7 +239,7 @@ def _subscribe_callback(
239239

240240
@staticmethod
241241
def _remove_callback(
242-
callbacks: List[RegistryCallback],
242+
callbacks: list[RegistryCallback],
243243
callback: RegistryCallback,
244244
) -> bool:
245245
if callback not in callbacks:

tests/test_registry_subscription.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import pytest
44

5-
from objectstate import ObjectStateRegistry, ObjectStateRegistrySubscription
5+
from objectstate import ObjectStateRegistry
6+
from objectstate.object_state_registry import ObjectStateRegistrySubscription
67

78

89
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)