Skip to content

Specifics of callables sometimes lost in error messages #3581

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JukkaL opened this issue Jun 21, 2017 · 1 comment
Closed

Specifics of callables sometimes lost in error messages #3581

JukkaL opened this issue Jun 21, 2017 · 1 comment
Labels
bug mypy got something wrong topic-error-reporting How we report errors topic-usability

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Jun 21, 2017

The name of of the callable argument and the fact that it has a default value are not displayed
in the second error message generated when type checking this example:

from typing import Callable, List
from mypy_extensions import Arg

a: List[Callable[[Arg(int, 'x')], None]]
reveal_type(a)  # Revealed type is 'builtins.list[def (x: builtins.int =)]'
a.x  # List[Callable[[int], None]] has no attribute "x"    <== Only "int"
@JukkaL JukkaL added the bug mypy got something wrong label Jun 21, 2017
@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 3, 2022

I'm closing this issue, as these features from mypy_extensions are deprecated.

The error messages for their replacement (callback protocols) also aren't great, but that seems like a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-error-reporting How we report errors topic-usability
Projects
None yet
Development

No branches or pull requests

2 participants