Skip to content

Detect bool expressions assigned to int variables #18500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dpinol opened this issue Jan 21, 2025 · 1 comment
Closed

Detect bool expressions assigned to int variables #18500

dpinol opened this issue Jan 21, 2025 · 1 comment
Labels

Comments

@dpinol
Copy link

dpinol commented Jan 21, 2025

Feature

A new optional rule to detect when bools are assigned to int.

def process_number(value: int) -> None:
    pass


process_number(True)

Pitch

Though technically bool's are int, code bases with type hints don't normally rely on this kind of c-language-like magic. On the other hand, I'm sure it will detect many bugs.

@dpinol dpinol added the feature label Jan 21, 2025
@A5rocks
Copy link
Collaborator

A5rocks commented Jan 21, 2025

Duplicate of #8363

@A5rocks A5rocks closed this as not planned Won't fix, can't repro, duplicate, stale Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants