Skip to content

Add return-type annotations to stop_server() and _repr_html_() in interface.py #8

Description

@tschm

Problem

Two public functions in src/pycharting/api/interface.py lack explicit return-type annotations:

  • stop_server() at interface.py:261 — should be -> None
  • _repr_html_() at interface.py:325 — should be -> str

make typecheck (ty) passes today because ty infers these, but the functions would flag under a mypy --strict posture, and the public API surface is inconsistently annotated (get_server_status() -> dict[str, Any] is annotated, the others are not).

Proposed fix

Add the explicit return types:

def stop_server() -> None:
    ...

def _repr_html_() -> str:
    ...

Verify plot(...) (interface.py:35) is also fully annotated while in the file.

Acceptance criteria

  • Every public function in interface.py has an explicit return-type annotation.
  • make typecheck still passes.

Subcategory: Type safety (8 → 9) from the Rhiza quality assessment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions