Tags: xometry/mypy
Tags
Allow Annotated to be wrapped around NotRequired. This allow the foll…
…owing testcase file to work correctly:
```python
from typing import TypedDict, Annotated, NotRequired
from pydantic import Field
class Test(TypedDict):
a: str
b: Annotated[str, Field(description="b")]
c: Annotated[NotRequired[str], Field(description="c")]
t: Test = {
"a": "testa",
"b": "testb",
"c": "testc",
}
t_noc: Test = {
"a": "testa",
"b": "testb",
}
```
1. Disallow direct item access of NotRequired TypedDict properties 2. When using .get() on a typeddict, the result type will now be a union of the dict[key] type and the type of the default parameter, instead of `object` Fixes python#12094 - replaces python#12095 which is now bitrotted
Merge branch 'issue-12094-error-on-notrequired-item-access' into comb… …ined-for-xometry
Set floating-point mypy version in Xometry local tag to make pydantic… ….mypy happy
PreviousNext