reveal_type() used with a TypedDict generates a long output that is quite different from the current syntax for defining a TypedDict. Example:
TypedDict(x=builtins.int, y=builtins.int, z=builtins.int, _fallback=typing.Mapping[builtins.str, builtins.int])
Not sure what's the best course action. Some ideas:
- Drop fallback if it's a
Mapping, since it's at least mostly redundant.
- Use
{'x': builtins.int, ...} instead of x=builtins.int, ....
- Support the syntax
TypedDict('Name', x=int, ...) for defining a TypedDict, so that the supported syntax is closer to reveal_type.
- Do something about required/non-required keys. The best approach probably depends on other choices.
reveal_type()used with a TypedDict generates a long output that is quite different from the current syntax for defining a TypedDict. Example:Not sure what's the best course action. Some ideas:
Mapping, since it's at least mostly redundant.{'x': builtins.int, ...}instead ofx=builtins.int, ....TypedDict('Name', x=int, ...)for defining a TypedDict, so that the supported syntax is closer toreveal_type.