ruff/crates/red_knot_python_semantic/resources/mdtest/annotations
David Peter f521358033
[red-knot] No errors for definitions of TypedDicts (#17674)
## Summary

Do not emit errors when defining `TypedDict`s:

```py
from typing_extensions import TypedDict

# No error here
class Person(TypedDict):
    name: str
    age: int | None

# No error for this alternative syntax
Message = TypedDict("Message", {"id": int, "content": str})
```

## Ecosystem analysis

* Removes ~ 450 false positives for `TypedDict` definitions.
* Changes a few diagnostic messages.
* Adds a few (< 10) false positives, for example:
  ```diff
+ error[lint:unresolved-attribute]
/tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/structured_configs/_utils.py:262:5:
Type `Literal[DataclassOptions]` has no attribute `__required_keys__`
+ error[lint:unresolved-attribute]
/tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/structured_configs/_utils.py:262:42:
Type `Literal[DataclassOptions]` has no attribute `__optional_keys__`
  ```
* New true positive

4f8263cd7f/corporate/lib/remote_billing_util.py (L155-L157)
  ```diff
+ error[lint:invalid-assignment]
/tmp/mypy_primer/projects/zulip/corporate/lib/remote_billing_util.py:155:5:
Object of type `RemoteBillingIdentityDict | LegacyServerIdentityDict |
None` is not assignable to `LegacyServerIdentityDict | None`
  ```

## Test Plan

New Markdown tests
2025-04-28 13:13:28 +02:00
..
annotated.md Special-case value-expression inference of special form subscriptions (#16877) 2025-03-20 21:46:02 +00:00
any.md [red-knot] Assignability for subclasses of Any and Unknown (#17557) 2025-04-23 11:37:30 +02:00
callable.md [red-knot] Detect version-related syntax errors (#16379) 2025-04-17 14:00:30 -04:00
deferred.md [red-knot] class bases are not affected by __future__.annotations (#17456) 2025-04-18 06:46:21 -07:00
int_float_complex.md Use python.typing.org for typing documentation links (#17323) 2025-04-09 20:38:20 +02:00
invalid.md [red-knot] Detect semantic syntax errors (#17463) 2025-04-23 09:52:58 -04:00
literal.md [red-knot] Handle explicit class specialization in type expressions (#17434) 2025-04-18 11:49:22 -04:00
literal_string.md [red-knot] No errors for definitions of TypedDicts (#17674) 2025-04-28 13:13:28 +02:00
never.md [red-knot] Statically known branches (#15019) 2024-12-21 11:33:10 +01:00
new_types.md red_knot_python_semantic: replace one use of "old" secondary diagnostic messages 2025-04-10 13:21:00 -04:00
optional.md [red-knot] Make' Type::in_type_expression()' exhaustive for Type::KnownInstance (#16836) 2025-03-19 07:36:28 -07:00
starred.md [red-knot] Detect version-related syntax errors (#16379) 2025-04-17 14:00:30 -04:00
stdlib_typing_aliases.md [red-knot] GenericAlias instances as a base class (#17575) 2025-04-23 10:39:10 +02:00
string.md [red-knot] optimize building large unions of literals (#17403) 2025-04-16 13:55:37 +00:00
union.md [red-knot] Fix false positives on types.UnionType instances in type expressions (#17297) 2025-04-09 18:33:16 +01:00
unsupported_special_forms.md [red-knot] No errors for definitions of TypedDicts (#17674) 2025-04-28 13:13:28 +02:00
unsupported_type_qualifiers.md [red-knot] No errors for definitions of TypedDicts (#17674) 2025-04-28 13:13:28 +02:00