Allow optionally preventing bool
from being accepted as a subtype of int
in MyPy.
#16135
Labels
bool
from being accepted as a subtype of int
in MyPy.
#16135
Feature
Allow optionally preventing
bool
from being accepted as a subtype ofint
in MyPy.Might be related? #8363
Pitch
Python treats
bool
as a subclass ofint
, causing potential bugs when abool
is used where anint
is expected. Adding a MyPy flag to reject this would improve type safety and code reliability.Disclaimer: I have read already https://mypy.readthedocs.io/en/stable/builtin_types.html?#simple-types
The text was updated successfully, but these errors were encountered: