KEMBAR78
(🐞) Wrong column number for `TypedDict.setdefault` · Issue #12271 · python/mypy · GitHub
Skip to content

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

@KotlinIsland

Description

@KotlinIsland
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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions