Skip to content
Discussion options

You must be logged in to vote

it's a special case, but one that's well defined by the python typing PEPs - type checkers handle the functional TypedDict just fine, even though it's a structurally dynamic syntax. i am not sure what maintainers would think of having this as a builtin extension, but i wrote a version of this that handles what we needed over here: pdm-project/pdm#3784

https://github.com/sneakers-the-rat/pdm/blob/7d3d57ce6645d4b0c60c63022e48bb790559bb11/docs/_ext/typeddict.py#L1-L111

where e.g. from this:

ToolPDMTable = TypedDict(
    "ToolPDMTable",
    {
        "distribution": bool,
        "ignore_package_warnings": list[str],
        "plugins": list[str],
        "build": BuildTable,
        # Control…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sneakers-the-rat
Comment options

Answer selected by sneakers-the-rat
@pawamoy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants