Skip to content

False negative with ParamSpec #13890

Closed
@hauntsaninja

Description

@hauntsaninja

On mypy master, this does not have any errors:

from typing import Callable, ParamSpec

P = ParamSpec('P')

def twice(f: Callable[P, int], *args: P.args) -> int:
  return f(*args) + f(*args)

With 0.982 you get main.py:5: error: Name "P.args" is not defined. Not the best error message, but at least you get an error for invalid use.

This bisects to https://github.com/python/mypy/pull/13472/files cc @sobolevn

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrongtopic-paramspecPEP 612, ParamSpec, Concatenate

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions