Skip to content

Commit f3df863

Browse files
committed
Update clear output state to set
1 parent 6439c44 commit f3df863

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jupyter_server_documents/outputs/output_processor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
from pycrdt import Map
44

5-
from traitlets import Unicode, Bool, Dict
5+
from traitlets import Unicode, Bool, Set
66
from traitlets.config import LoggingConfigurable
77
from jupyter_server_documents.kernels.message_cache import KernelMessageCache
88

99
class OutputProcessor(LoggingConfigurable):
1010

1111
_file_id = Unicode(default_value=None, allow_none=True)
12-
_pending_clear_output_cells = Dict(default_value={})
12+
_pending_clear_output_cells = Set(default_value=set())
1313

1414
use_outputs_service = Bool(
1515
default_value=True,
@@ -91,7 +91,7 @@ def clear_cell_outputs(self, cell_id) -> asyncio.Task | None:
9191
)
9292
self.outputs_manager.clear(file_id=self._file_id, cell_id=cell_id)
9393

94-
self._pending_clear_output_cells.pop(cell_id, None)
94+
self._pending_clear_output_cells.discard(cell_id)
9595

9696
return clear_outputs_task
9797

@@ -121,7 +121,7 @@ async def output_task(self, msg_type, cell_id, content):
121121
if clear_task:
122122
await clear_task
123123
else:
124-
self._pending_clear_output_cells[cell_id] = True
124+
self._pending_clear_output_cells.add(cell_id)
125125

126126
return
127127

0 commit comments

Comments
 (0)