Skip to content

Python: Add reasons to runtime typing suppressions #9629

Open

Description

Maintainer-owned issue. Community contributors: please do not pick up or start implementing this issue.

Category

Repository maintenance

Problem

Runtime source contains many type-checker suppressions without a brief reason explaining the valid runtime contract or checker limitation. Broad ignores make it difficult to distinguish intentional dynamic behavior from hidden type defects.

Evidence

The audit found hundreds of suppression-related matches, with notable concentrations in Core observability, middleware, agents, security, and serialization, plus provider package private-usage suppressions. python/CODING_STANDARD.md now permits targeted # type: ignore[...] in internal code when it is clearer, but requires an inline reason.

Desired Outcome

Add concise reasons to retained suppressions, replace broad ignores with rule-specific forms, and improve annotations, overloads, or Protocols where that removes the suppression without runtime complexity. Prioritize runtime source before tests and samples.

Language

Python

Acknowledgements

  • I searched existing issues and did not find a duplicate.
  • I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.

Ownership: Core maintainers only; not available for community pickup.

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

    pythonUsage: [Issues, PRs], Target: Python

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions