Skip to content

Dict literal in TypedDict context #2487

Description

@JukkaL

A compatible dict literal should be valid if the type context is a typed dict type. Example:

frommypy_extensionsimportTypedDictPoint=TypedDict('Point', {'x': int, 'y': int})
deff(p: Point) ->None: passf({'x': 1, 'y': 3}) # Okp= {'x': 2, 'y': 3} # type: Point # Ok

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions