Skip to content

Better message for nested TypedDict #4299

@JukkaL

Description

@JukkaL

An attempt to define a nested TypedDict results in a not very helpful message:

from mypy_extensions import TypedDict

D = TypedDict('D', {
    'x': TypedDict('E', {  # Invalid field type
        'y': int
    })
})

A better message could be something like "Inline TypedDict types not supported; use assignment" statement to define a TypedDict".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions