Skip to content

Type-hint pass on parley/preferences.py and parley/transcript.py #37

Description

@5uper0

Same shape as #14 (merged as #32, which covered consensus.py + agent.py): tighten the loose annotations in two core modules. Hints only — zero behaviour change. These two files are the red-line guard and the tamper-evidence record, so the diff must be provably inert: annotations and typing imports, nothing else.

What is wanted

parley/preferences.py:

  • Evaluation.violated: listList[str]
  • PreferenceSheet.__init__: hard: Optional[list]Optional[List[HardConstraint]]; annotate the instance attributes and add the missing -> None

parley/transcript.py:

  • self.entriesList[dict] (annotate in __init__)
  • record(self, option: Any, verdicts)verdicts is a sequence of Verdict; hint it as Iterable[Verdict] with the import under typing.TYPE_CHECKING (plus from __future__ import annotations) so the module gains no new runtime import
  • to_dict() -> dict and finalize(...) are already annotated; leave them

Match the style the #32 pass used (explicit typing.List/Optional imports, no from x import *).

How to verify

.venv/bin/pytest -q tests/test_preferences.py tests/test_transcript.py
.venv/bin/pytest -q

Identical pass/fail as before your change — the diff is annotations only.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions