Skip to content

"parameterized generics" should be "argumentized generic types" #20999

@hyperkai

Description

@hyperkai

Setting a generic type with a type specification [] to isinstance() and issubclass() gets the wrong error messages as shown below:

*Notes:

  • mypy test.py
  • Python 3.15.0a6
x = 100

isinstance(x, tuple)           # No error
isinstance(x, tuple[int, str]) # Error

class Cls: ...

issubclass(Cls, tuple)           # No error
issubclass(Cls, tuple[int, str]) # Error

error: Parameterized generics cannot be used with class or instance checks

Actually, saying "parameterized" reminds function parameters so "argumentized" should be used and "generic types" should also be used as shown below:

*Notes:

  • "argumentized" isn't common in general but it's intuitive for the case so it can be used in the tech world.

error: Argumentized generic types cannot be used with class or instance checks

parameterized
argumentized

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions