Add experimental support for PEP 764 inline TypedDicts
Refs #18748
I opted to put this behavior behind a new feature flag (instead of tying it to the existing InlineTypedDict flag), since that helps avoid issues with mixing the existing syntax and PEP-764 syntax. Suggestions about how to name the flag / how to best reconcile this with the existing InlineTypedDict flag would be welcome.
cc @Viicos
Diff from mypy_primer, showing the effect of this PR on open source code:
steam.py (https://github.com/Gobot1234/steam.py)
- steam/http.py:907: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: error: Legacy inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: note: Did you mean TypedDict[...]?
pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/validators.py:630: error: Unused "type: ignore" comment [unused-ignore]
+ pydantic/v1/annotated_types.py:49: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
steam.py (https://github.com/Gobot1234/steam.py)
- steam/http.py:907: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: error: Legacy inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: note: Did you mean TypedDict[...]?
pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/validators.py:630: error: Unused "type: ignore" comment [unused-ignore]
+ pydantic/v1/annotated_types.py:49: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
steam.py (https://github.com/Gobot1234/steam.py)
- steam/http.py:907: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: error: Legacy inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:907: note: Did you mean TypedDict[...]?
pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/validators.py:630: error: Unused "type: ignore" comment [unused-ignore]
+ pydantic/v1/annotated_types.py:49: error: Unused "type: ignore" comment [unused-ignore]
Diff from mypy_primer, showing the effect of this PR on open source code:
pydantic (https://github.com/pydantic/pydantic)
+ pydantic/v1/validators.py:630: error: Unused "type: ignore" comment [unused-ignore]
+ pydantic/v1/annotated_types.py:49: error: Unused "type: ignore" comment [unused-ignore]
steam.py (https://github.com/Gobot1234/steam.py)
- steam/http.py:910: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:910: error: Legacy inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc]
+ steam/http.py:910: note: Did you mean TypedDict[...]?