Bug report
Bug description:
Setting a generic type with a type specification [] to isinstance() and issubclass() gets the wrong error messages as shown below:
*Notes:
x = 100
isinstance(x, tuple) # No error
isinstance(x, tuple[int, str]) # Error
TypeError: isinstance() argument 2 cannot be a parameterized generic
class Cls: ...
issubclass(Cls, tuple) # No error
issubclass(Cls, tuple[int, str]) # Error
TypeError: issubclass() argument 2 cannot be a parameterized generic
Actually, saying "parameterized" reminds function parameters so "argumentized" should be used and "type" should also be used after "generic" as shown below:
*Notes:
- "argumentized" isn't common but intuitive.
TypeError: isinstance() argument 2 cannot be an argumentized generic type
TypeError: issubclass() argument 2 cannot be an argumentized generic type
parameterized
argumentized
CPython versions tested on:
3.15
Operating systems tested on:
Windows
Linked PRs
Bug report
Bug description:
Setting a generic type with a type specification
[]toisinstance()andissubclass()gets the wrong error messages as shown below:*Notes:
Actually, saying "parameterized" reminds function parameters so "argumentized" should be used and "type" should also be used after "generic" as shown below:
*Notes:
CPython versions tested on:
3.15
Operating systems tested on:
Windows
Linked PRs