Skip to content

MyPy not recognizing ParamSpec usage with Generic #11362

Closed
@shughes-uk

Description

@shughes-uk

Bug Report

Some latest MRs intend to make ParamSpec ignored, but do not seem to cover the use case of ParamSpec with Generic

To Reproduce

from typing import Generic

from typing_extensions import ParamSpec

P = ParamSpec("P")


class Test(Generic[P]):
    pass

Expected Behavior

MyPy should detect no errors

Actual Behavior

error: Free type variable expected in Generic[...]

Your Environment

  • Mypy version used: mypy 0.920+dev.9aaeef5f355509ef789dbcdca1f15793698a5960
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.8.5
  • Operating system and version: OSX

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