Skip to content

Concatenate false negative (caught by pyright, but not mypy) #14169

Closed

Description

@supersergiy

Bug Report
False negative in the following example:

To Reproduce
Playground Link

from typing import Protocol
from typing_extensions import ParamSpec, Concatenate

P = ParamSpec("P")

class A(Protocol[P]):
    def foo(self, *args: P.args, **kwargs: P.kwargs):
        ...
    
def bar(b: A[P]) -> A[Concatenate[int, P]]:
    return b # no error

Expected Behavior

Type error on return b, which is what pyright does (pyright playground)

Actual Behavior

No type error.

Your Environment

  • Mypy version used: 0.991

Activity

  1. added
    bug
    on Nov 23, 2022
  2. added
    topic-paramspec
    on Feb 12, 2023
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

    bugtopic-paramspec

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions