Skip to content

Regression for TypedDict default getattr #14481

Closed
@ilinum

Description

@ilinum

This generates an error on latest error but not on mypy 0.991

from typing import TypedDict

D = TypedDict("D", {"foo": int}, total=False)


def f(d: dict[str, D]) -> None:
    args = d["a"]
    args.update(d.get("b", {}))

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