New submission from noobie1000 <balajes...@gmail.com>:

Hello,

Recently I observed that isinstance(x, int) returns True, even when x is 
defined as a bool. While I understand that internally, a bool is treated as an 
int with values 0 and 1; to me, this is a bit misleading that the python 
interpreter returns True when we perform the isinstance() check. May be I'm 
missing some deeper explanation. Could someone please shed some light on this. 
Has this been discussed by the community in the past. Thank you very much for 
reading this ticket.

>>> x = True
>>> isinstance(x, int)
True

----------
components: IO
messages: 406926
nosy: noobie1000
priority: normal
severity: normal
status: open
title: bool variable isinstance of int
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45891>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to