Skip to content

Remove unused TypeVars and ParamSpecs - #1014

Open
zigpy-review-bot wants to merge 1 commit into
devfrom
zigpy-bot/issue-999-orphaned-typevars
Open

zigpy-review-bot wants to merge 1 commit into
devfrom
zigpy-bot/issue-999-orphaned-typevars

Conversation

@zigpy-review-bot

Copy link
Copy Markdown
Collaborator

Summary

Removes leftover type variables that are defined but never used, as reported in #999.

Changes

  • zha/async_.py: remove the unused _Ts = TypeVarTuple("_Ts") and its import.
  • zha/application/gateway.py: remove the unused _R TypeVar and the TypeVar import.
  • zha/application/helpers.py: remove the unused _T, _R and _P and the ParamSpec / TypeVar imports.

No behaviour change. The remaining type variables in the package are all referenced (checked per name with grep).

Testing

  • ruff check / ruff format and mypy on zha/ are clean.
  • tests/test_gateway.py, tests/test_async_.py and tests/test_application_helpers.py: 114 passed.

Fixes #999

Drop the orphaned _Ts TypeVarTuple in zha.async_, _R in zha.application.gateway and _T/_R/_P in zha.application.helpers, plus their now-unused imports.
@zigpy-review-bot zigpy-review-bot added the code quality Improvement to code quality label Nov 12, 2026
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.48%. Comparing base (2da1a5b) to head (12f63a4).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1014      +/-   ##
==========================================
- Coverage   97.48%   97.48%   -0.01%     
==========================================
  Files          61       61              
  Lines       10870    10865       -5     
==========================================
- Hits        10597    10592       -5     
  Misses        273      273              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

code quality Improvement to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up orphaned Type Parameters

2 participants