Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Better message for nested TypedDict #4299

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".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions