Skip to content
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

(🐞) Wrong column number for TypedDict.setdefault #12271

Open
KotlinIsland opened this issue Mar 2, 2022 · 0 comments
Open

(🐞) Wrong column number for TypedDict.setdefault #12271

KotlinIsland opened this issue Mar 2, 2022 · 0 comments
Labels
bug mypy got something wrong topic-error-reporting How we report errors topic-typed-dict

Comments

@KotlinIsland
Copy link
Contributor

from typing import TypedDict

class A(TypedDict):
    x: int
a: A
a.setdefault('x', '')  # test.py:6:1: error: Argument 2 to "setdefault" of "TypedDict" has incompatible type "str"; expected "int"

column 1?

Internally an error with the correct column number is generated, but is filtered out as a duplicate.

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-typed-dict
Projects
None yet
Development

No branches or pull requests

2 participants