Skip to content

Upper bound is missing from generic function signature in error report #17792

Closed
@jolaf

Description

@jolaf

Bug Report

The provided test defines the generic function f() in two ways which are incompatible with each other – one has an upper bound, and the other has not.

However, when reporting this incompatibility, mypy prints two signatures that look equivalent because the upper bound is not mentioned in one of them.

This makes it very difficult to understand why mypy reports an error and how to fix it. Moreover, the error report looks like a bug in mypy.

To Reproduce

https://mypy-play.net/?mypy=1.11.2&python=3.12&enable-incomplete-feature=NewGenericSyntax&gist=06224b5d473a6be86cae73f00e4643f1

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