Skip to content

ParamSpec-specified signatures on overridden functions are erroniously marked as incompatible #14288

@schuelermine

Description

@schuelermine

Bug Report

(With --strict) ParamSpec-specified signatures on overridden functions are erroniously marked as incompatible. See example:

(A clear and concise description of what the bug is.)

To Reproduce

https://mypy-play.net/?mypy=latest&python=3.11&gist=61ea52ad668dcf68ca8c446e339a570d

Expected Behavior

The signature is accepted as compatible

Actual Behavior

Signature of "call" incompatible with supertype "Spam"  [override]
     Superclass:
         def [P`-1] call(self, *args: P.args, **kwargs: P.kwargs) -> Spam[<nothing>]
     Subclass:
         def [P`-1] call(self, *args: P.args, **kwargs: P.kwargs) -> Eggs[<nothing>]

Your Environment

  • Mypy version used: mypy 0.991 (compiled: yes)
  • Mypy command-line flags: --strict
  • Mypy configuration options from mypy.ini (and other config files): strict = true
  • Python version used: Python 3.10.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions