Skip to content

Clean up orphaned Type Parameters #999

Description

@FrancescoPezzella

Hello there :)

While doing some research about Python's types, I came upon this PR.

I noticed that there are still some leftover orphaned Type Params in some files, such as:
_Ts = TypeVarTuple("_Ts")
zha/async_.py: Orphaned Type Params aka dead code is not automatically detected by Python.

I would be happy to open a PR and clean up any more instances I find using a tool to detect them. The change is relatively straight-forward.

Activity

  1. pjljvandelaar commented on Nov 12, 2026

    @pjljvandelaar

    @FrancescoPezzella Can you pick up this Task?

  2. zigpy-review-bot commented on Nov 12, 2026

    @zigpy-review-bot
    Collaborator

    Opened #1014 to remove the orphaned type variables: _Ts in zha/async_.py, _R in zha/application/gateway.py and _T / _R / _P in zha/application/helpers.py, plus their now-unused imports. The other TypeVars in the package are all referenced.

    ruff, mypy and the gateway / async / helpers tests pass.

    If the reporter still wants to take this on, they are welcome to build on or replace #1014.

  3. removed their assignment
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    code qualityImprovement to code quality

    Type

    Fields

    Priority

    None yet

    Size

    None yet

    Area

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions