ruff/crates/ty_python_semantic/resources/mdtest/call
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
..
annotation.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
builtins.md [ty] More precise type inference for dictionary literals (#20523) 2025-09-24 18:12:00 -04:00
callable_instance.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
callables_as_descriptors.md [ty] Treat Callable dunder members as bound method descriptors (#20860) 2025-10-14 14:27:52 +02:00
constructor.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
dunder.md [ty] Rename "possibly unbound" diagnostics to "possibly missing" (#20492) 2025-09-23 14:26:55 +00:00
dunder_import.md [ty] Add special-cased inference for __import__(name) and importlib.import_module(name) (#19008) 2025-06-29 11:49:23 +01:00
function.md [ty] Heterogeneous unpacking support for unions (#20377) 2025-10-15 19:30:03 +01:00
getattr_static.md Update default and latest Python versions for 3.14 (#20725) 2025-10-07 12:23:11 -04:00
invalid_syntax.md ty_python_semantic: add union type context to function call type errors 2025-05-09 13:40:51 -04:00
methods.md [ty] Improve error messages for unresolved attribute diagnostics (#20963) 2025-10-19 10:58:25 +01:00
never.md
open.md [ty] Todo-types for os.fdopen, NamedTemporaryFile, and Path.open (#20549) 2025-09-24 15:43:58 +02:00
overloads.md [ty] Filter out revealed-type and undefined-reveal diagnostics from mdtest snapshots (#20820) 2025-10-12 18:39:32 +00:00
replace.md [ty] Sync vendored typeshed stubs (#20658) 2025-10-01 10:11:48 +02:00
str_startswith.md [ty] "foo".startswith is not an instance of types.MethodWrapperType (#20317) 2025-09-10 11:14:26 +00:00
subclass_of.md [ty] Include synthesized arguments in displayed counts for too-many-positional-arguments (#18098) 2025-05-14 22:51:23 -04:00
union.md [ty] Use annotated parameters as type context (#20635) 2025-10-03 17:14:51 -04:00