-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
questionAsking for support or clarificationAsking for support or clarification
Description
Currently, this rule only flags int | float unions as redundant. Coming from other languages, I didn't even realize int was a subtype of float, but I learned about it because of this rule. However, I found a bug in my code where I was converting False to 0.0 - this was because in Python, bool is actually an int. I found that the tests for this rule very explicitly consider int | bool to not be a violation, however this would have prevented me from writing the bug as I did.
The bool to int relation is in some ways stronger than int to float since isinstance() only recognizes the former:

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionAsking for support or clarificationAsking for support or clarification