[New-bugs-announce] [issue44932] `issubclass` and `isinstance` doesn't check for all 2nd argument types

theeshallnotknowethme report at bugs.python.org
Tue Aug 17 03:26:02 EDT 2021


New submission from theeshallnotknowethme <nohackingofkrowten at gmail.com>:

When I tried using `isinstance` with a type (e.g. `bool`) as the 1st argument and a parameterized generic in a tuple (e.g. '(`bool`, `list[bool]`)') as the 2nd argument, it raised a `TypeError`, 'isinstance() argument 2 cannot be a parameterized generic'. But when I did the same thing in `issubclass`, it returned a boolean and did not raise any `TypeError`s. Using `isinstance` with an object as the 1st argument and the same tuple 2nd argument also returned a boolean, and did not raise any `TypeError`s. Is this expected behaviour, or should this be fixed? This was tested in Python 3.10.0rc1 in a 64-bit system.

----------
components: Tests, Windows
messages: 399717
nosy: February291948, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: `issubclass` and `isinstance` doesn't check for all 2nd argument types
type: behavior
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44932>
_______________________________________


More information about the New-bugs-announce mailing list