Skip to content

Commit

Permalink
Union[bool, str] instead of the pipe operator for compatibility with …
Browse files Browse the repository at this point in the history
…older Python versions
  • Loading branch information
bonassifabio committed Dec 9, 2024
1 parent cca9beb commit 641ec1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ignite/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def __init__(self, process_function: Callable[["Engine", Any], Any]):
self.last_event_name: Optional[Events] = None
# should_terminate flag: False - don't terminate, True - terminate,
# "skip_completed" - terminate and skip the event "COMPLETED"
self.should_terminate: bool | str = False
self.should_terminate: Union[bool, str] = False
# should_terminate_single_epoch flag: False - don't terminate, True - terminate,
# "skip_epoch_completed" - terminate and skip the event "EPOCH_COMPLETED"
self.should_terminate_single_epoch: bool | str = False
self.should_terminate_single_epoch: Union[bool, str] = False
self.should_interrupt = False
self.state = State()
self._state_dict_user_keys: List[str] = []
Expand Down

0 comments on commit 641ec1a

Please sign in to comment.