Skip to content

Commit

Permalink
Added type checks for ConditionTracer classes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-zeller committed Oct 15, 2024
1 parent 0ec10e7 commit 564b090
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions notebooks/Tracer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)"
Expand Down

0 comments on commit 564b090

Please sign in to comment.