Skip to content

Execute the Template Helpers Any Reduction RFC against current code #146

Description

@lbliii

Context

There is already a draft RFC for reducing Any in runtime helpers, but the current code has broader Any usage than the RFC's old counts and the work has not landed. This is a good bounded typing cleanup that strengthens refactoring safety without changing public behavior.

Evidence

  • plan/rfc-template-helpers-any-reduction.md is still Status: Draft.
  • A current scan shows 576 Any/dict[str, Any]/cast( matches under src/kida.
  • Hotspots include src/kida/template/helpers.py, src/kida/template/render_helpers.py, src/kida/environment/core.py, and src/kida/compiler/partial_eval.py.
  • The RFC's current-state counts are stale; for example, template/helpers.py now has many more Any usages than the four listed in the RFC.

Proposed Scope

  • Refresh the RFC counts against current code.
  • Land a narrow first PR focused on helper/filter/render-helper signatures where object or Protocols are clearly better than Any.
  • Leave inherently dynamic template context APIs alone unless there is a clear type contract.

Done When

  • The RFC is either updated and active, or closed with implemented work linked.
  • A first bounded Any reduction lands with make ty clean.
  • No runtime behavior changes are introduced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions