From 564b090a6713fc06abf2e90332edb359c014600d Mon Sep 17 00:00:00 2001 From: Andreas Zeller Date: Tue, 15 Oct 2024 12:48:05 +0200 Subject: [PATCH] Added type checks for ConditionTracer classes --- notebooks/Tracer.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notebooks/Tracer.ipynb b/notebooks/Tracer.ipynb index bf132a01..8b67de74 100644 --- a/notebooks/Tracer.ipynb +++ b/notebooks/Tracer.ipynb @@ -940,6 +940,7 @@ "\n", " if condition is None:\n", " condition = 'False'\n", + " assert isinstance(condition, str)\n", "\n", " self.condition: str = condition\n", " self.last_report: Optional[bool] = None\n", @@ -1198,6 +1199,7 @@ " def __init__(self, *, condition: Optional[str] = None,\n", " events: List[str] = [], file: TextIO = sys.stdout) -> None:\n", " \"\"\"Constructor. `events` is a list of expressions to watch.\"\"\"\n", + " assert isinstance(events, List) # avoid type errors\n", " self.events = events\n", " self.last_event_values: Dict[str, Any] = {}\n", " super().__init__(file=file, condition=condition)"