ruff/crates/ty_python_semantic/resources/mdtest/scopes
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
..
annotate_global.md [pyflakes] Fix false positives for __annotate__ (Py3.14+) and __warningregistry__ (F821) (#20154) 2025-09-23 08:16:00 -04:00
builtin.md [ty] No union with Unknown for module-global symbols (#20664) 2025-10-01 16:40:30 +02:00
eager.md [ty] No union with Unknown for module-global symbols (#20664) 2025-10-01 16:40:30 +02:00
global-constants.md [ty] Add support for global __debug__ constant (#18540) 2025-06-10 06:48:59 +00:00
global.md [ty] No union with Unknown for module-global symbols (#20664) 2025-10-01 16:40:30 +02:00
moduletype_attrs.md Update default and latest Python versions for 3.14 (#20725) 2025-10-07 12:23:11 -04:00
nonlocal.md [ty] improve lazy scope place lookup (#19321) 2025-07-25 07:11:11 +00:00
unbound.md [ty] Improve error messages for unresolved attribute diagnostics (#20963) 2025-10-19 10:58:25 +01:00