Skip to content

MyPy not recognizing ParamSpec usage with Generic #11362

Closed

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

Activity

  1. sobolevn commented on Oct 23, 2021

    @sobolevn
    Member

    Related #8645

  2. 97littleleaf11 commented on Dec 7, 2021

    @97littleleaf11
    Collaborator

    Fixed by recent PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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