Skip to content

TypedDict in 3.8 gives unexpected error? #832

@IanVermes

Description

@IanVermes

@rchen152 Forgive me for the naive question, but am I correct that TypedDict support from the typing module is not supported by PyType (as of version 2021.02.09 while running against Python 3.8)? Issue #680 corroborates this but the error message I get is unclear.

I get an import-error rather than a not supported error, which is confusing me. Equally I may be doing something utterly wrong!

I get the following

$ pytype -V 3.8
...
Can't find module 'typing.TypedDict'. [import-error]
# some_file.py
from typing import TypedDict

Keywords = TypedDict(
    "Keywords",
    {
        "foo": str,
        "bar": str,
        "bat": bool,
    },
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcat: corecore language and typing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions