Skip to content

Feature request: rule that completely disallows typing.cast #10670

Open
@wyattscarpenter

Description

@wyattscarpenter

cast() gets around static type safety without ensuring dynamic type correctness. Sometimes you have to use it—you know how it is—but it's not ideal. (For instance, mypy documentation seems to imply the main use of cast is when the typechecker or type annotations aren't quite good enough.) That means, in my opinion, cast is a great candidate to have a rule disallowing its use, to ensure code quality in codebases where it is not needed, even if that rule is ultimately optional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-decisionAwaiting a decision from a maintainerruleImplementing or modifying a lint rule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions