Skip to content

Commit a5e459b

Browse files
Kasper Jungeclaude
authored andcommitted
refactor: encapsulate RunState internal threading fields
Mark _stop_requested, _pause_event, and _reload_requested with init=False, repr=False, compare=False to properly encapsulate internal control state. These fields are only accessed through properties and methods — they should not appear in the constructor, repr output, or equality comparisons. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bdde042 commit a5e459b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/ralphify/_run_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class RunState:
8787
timed_out: int = 0 # subset of ``failed``; see class docstring
8888
started_at: datetime | None = None
8989

90-
_stop_requested: bool = False
91-
_pause_event: threading.Event = field(default_factory=threading.Event)
92-
_reload_requested: bool = False
90+
_stop_requested: bool = field(default=False, init=False, repr=False, compare=False)
91+
_pause_event: threading.Event = field(default_factory=threading.Event, init=False, repr=False, compare=False)
92+
_reload_requested: bool = field(default=False, init=False, repr=False, compare=False)
9393

9494
@property
9595
def total(self) -> int:

0 commit comments

Comments
 (0)