Skip to content

Get rid of fake TypeInfo's for TypedDicts #8620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ilevkivskyi opened this issue Apr 2, 2020 · 0 comments
Open

Get rid of fake TypeInfo's for TypedDicts #8620

ilevkivskyi opened this issue Apr 2, 2020 · 0 comments
Labels
bug mypy got something wrong priority-1-normal refactoring Changing mypy's internals topic-typed-dict

Comments

@ilevkivskyi
Copy link
Member

We currently create fake TypeInfos to store TypedDicts. This used to cause various issues, in particular, currently the type of a TypedDict "class object" in runtime context is () -> SomeTypedDict, where the return type is an instance of the fake TypeInfo.

We can probably fix latter by just constructing a reasonable type, but a more global solution would be to get rid of the fake TypeInfo entirely. It is not needed for anything and just complicates things. We will need to put some symbol node in the symbol table, so we would need a new SymbolNode subclass (or reuse TypeAlias, so a TypedDict definition A = TypedDict('A' {'x': int, 'y': int}) will be very similar to A = Dict[str, int]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong priority-1-normal refactoring Changing mypy's internals topic-typed-dict
Projects
None yet
Development

No branches or pull requests

1 participant