basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

intersections don't work on `TypedDict`s

Open DetachHead opened this issue 2 years ago • 0 comments

Describe the problem, ie expected/actual result (if it's not blatantly obvious)

No response

Gist to reproduce

from __future__ import annotations
from typing import TypedDict

class Foo(TypedDict):
    a: int


class Bar(TypedDict):
    b: str

# Incompatible types in assignment (expression has type "dict[str, int | str]", variable has type "Foo & Bar")  [assignment]
asdf: Foo & Bar = {"a": 1, "b": ""}

DetachHead avatar Sep 20 '23 07:09 DetachHead