ruff/crates/ty_python_semantic/resources/mdtest/expression
Alex Waygood 1f8297cfe6
[ty] Improve error messages for unresolved attribute diagnostics (#20963)
## Summary

- Type checkers (and type-checker authors) think in terms of types, but
I think most Python users think in terms of values. Rather than saying
that a _type_ `X` "has no attribute `foo`" (which I think sounds strange
to many users), say that "an object of type `X` has no attribute `foo`"
- Special-case certain types so that the diagnostic messages read more
like normal English: rather than saying "Type `<class 'Foo'>` has no
attribute `bar`" or "Object of type `<class 'Foo'>` has no attribute
`bar`", just say "Class `Foo` has no attribute `bar`"

## Test Plan

Mdtests and snapshots updated
2025-10-19 10:58:25 +01:00
..
assert.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
attribute.md [ty] Improve error messages for unresolved attribute diagnostics (#20963) 2025-10-19 10:58:25 +01:00
boolean.md [ty] Make tuple subclass constructors sound (#19469) 2025-07-21 21:25:11 +00:00
if.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
lambda.md [ty] Treat lambda functions as instances of types.FunctionType (#18431) 2025-06-02 16:46:26 +01:00
len.md [ty] Proper assignability/subtyping checks for protocols with method members (#20165) 2025-09-12 10:10:31 +00:00
yield_and_yield_from.md [ty] Support async/await, async with and yield from (#19595) 2025-07-30 11:51:21 +02:00