[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000


New submission from noobie1000 :

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 
<https://bugs.python.org/issue45891>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000


noobie1000  added the comment:

Hello Steven,

Sorry, this is my first ever post and was lost in the enormity of 
issues/documentation. Noted your points :)

Thank you.

--
resolution: not a bug -> 
status: closed -> open

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



[issue45891] bool variable isinstance of int

2021-11-24 Thread noobie1000


Change by noobie1000 :


--
status: open -> closed

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