From 8440dbfb0a05b14a833d0ae4fe4c6167da08fac0 Mon Sep 17 00:00:00 2001 From: Golf Player <> Date: Mon, 1 Jun 2020 03:28:42 -0500 Subject: [PATCH] Use a tuple for history --- nbclient/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nbclient/client.py b/nbclient/client.py index 54fe3522..153b8dc3 100644 --- a/nbclient/client.py +++ b/nbclient/client.py @@ -309,7 +309,7 @@ def __init__(self, nb, km=None, **kw): } def _update_state(self, new_state): - self.state_history.append([new_state, timestamp()]) + self.state_history.append((new_state, timestamp())) def reset_execution_trackers(self): """Resets any per-execution trackers. @@ -323,7 +323,8 @@ def reset_execution_trackers(self): self.output_hook_stack = collections.defaultdict(list) # our front-end mimicing Output widgets self.comm_objects = {} - self.state_history = [ExecutionState.IDLE, timestamp()] + self.state_history = [] + self._update_state(ExecutionState.IDLE) self.current_cell = None self.current_cell_index = -1