Skip to content
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

inline typed dicts should not need to be wrapped in dict[] #585

Open
DetachHead opened this issue Aug 16, 2024 · 2 comments
Open

inline typed dicts should not need to be wrapped in dict[] #585

DetachHead opened this issue Aug 16, 2024 · 2 comments
Labels
based non-standard/breaking change (eg. would cause issues in 3rd party code)

Comments

@DetachHead
Copy link
Owner

mypy added support for them in python/mypy#17457, but it differs from ours:

# mypy:
foo: {"foo": str}
# basedpyright:
foo: dict[{"foo": str}]

i like mypy's one better so we should switch to that instead

@DetachHead DetachHead added the based non-standard/breaking change (eg. would cause issues in 3rd party code) label Aug 16, 2024
@DetachHead DetachHead changed the title inline typed discts should not need to be wrapped in dict[] inline typed dicts should not need to be wrapped in dict[] Aug 16, 2024
@KotlinIsland
Copy link
Collaborator

Why not both? I imagine the current would be easier for runtime introspection, an aspect that I can only assume mypy overlooked

@DetachHead
Copy link
Owner Author

i dont care about runtime introspection tbh, all of it is a complete mess anyway that only exists as an implementation detail of the type system as a result of them refusing to add new syntax to the language rather than any conscious decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
based non-standard/breaking change (eg. would cause issues in 3rd party code)
Projects
None yet
Development

No branches or pull requests

2 participants