-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
Description
As it was discussed in #8069, sometimes we need to logically separate int and bool types.
Currently mypy allows this to happen:
def some(a: int): ...
some(x > 1)Because bool is subtype of int. I am proposing to add a strict-bool mode, so bool would be treated as a non-int type. And this code would generate an error.
It can be a new config option: --strict-bool or a new disabled by default error code in the future as @JukkaL suggested.
rvanlaar, ruuda, Calinou, intgr, tuukkamustonen and 18 morejorenham and sterliakov